humanmade / Mercator

WordPress multisite domain mapping for the modern era.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WMPL home url fix

TrilipuT opened this issue · comments

Hey!
Thanks for great plugin!
I use multinetwork and WPML on it, so i noticed one problem: on homepage native language switcher return me native url. I check code and it get's value from $wpdb->blogs.
So here is my quick fix, maybe you can add it into code

add_filter( 'wpml_url_converter_get_abs_home', function ( $absolute_home ) {

	if ( function_exists( 'Mercator\mangle_url' ) ) {
		return Mercator\mangle_url( $absolute_home, '', 'relative' );
	}

	return $absolute_home;
});

Hi @TrilipuT, thanks for using Mercator. :)

While it'd be nice to have WPML compatibility, it doesn't make sense for us to add WPML-specific functionality to Mercator. In this case, it may be possible for WPML to run different filters that make the two compatible, however otherwise, I'd recommend publishing your snippet of code here as a bridge plugin between the two. :)

I'm going to close this out, as it's not something we'll add to Mercator itself.

Hi,

I have this issue.
Could you advice how to fix on my site?