Skip to content

Instantly share code, notes, and snippets.

@dotMastaz
Created March 28, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dotMastaz/39ce6a0635e997d4ffa06ffbd7a171c6 to your computer and use it in GitHub Desktop.
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...
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