Created
March 28, 2017 08:36
-
-
Save dotMastaz/39ce6a0635e997d4ffa06ffbd7a171c6 to your computer and use it in GitHub Desktop.
WordPress (v4.7.3) : GeoMyWP (v2.7) no result issue when PolyLang (2.1.2) is actived : Fixed with this...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gmw_polylang_remove_query_var( $args ) { | |
foreach( $args->query_vars['tax_query'] as $key => $value ) { | |
if ( $value['taxonomy'] == 'language' ) { | |
unset( $args->query_vars['tax_query'][$key] ); | |
} | |
} | |
remove_filter( 'parse_query', 'gmw_polylang_remove_query_var', 99 ); | |
return $args; | |
} | |
function gmw_remove_polylang_from_search_query( $args, $gmw ) { | |
add_filter( 'parse_query', 'gmw_polylang_remove_query_var', 99 ); | |
return $args; | |
} | |
add_filter( 'gmw_pt_search_query_args', 'gmw_remove_polylang_from_search_query', 99, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment