Last active
September 29, 2020 13:33
-
-
Save djrmom/1bf75741ecb310570db5902507ca0db6 to your computer and use it in GitHub Desktop.
facetwp wpml indexing
This file contains 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
<?php | |
/** fix for second lang being deleted on post index */ | |
add_filter( 'facetwp_indexer_query_args', function( $args ) { | |
if ( function_exists( 'is_checkout' ) && is_checkout() ) { | |
return $args; | |
} | |
do_action( 'wpml_switch_language', 'all' ); | |
$args['suppress_filters'] = true; // query posts in all languages | |
return $args; | |
}, 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment