Last active
October 6, 2017 14:19
-
-
Save mgibbs189/883456b4593ae313e041926fecaa1049 to your computer and use it in GitHub Desktop.
Pass the language code when preloading (WPML, Polylang)
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 | |
// Add the following | |
add_filter( 'facetwp_render_params', function( $params ) { | |
if ( isset( $params['is_preload'] ) && defined( 'ICL_LANGUAGE_CODE' ) ) { | |
$params['http_params']['lang'] = ICL_LANGUAGE_CODE; | |
} | |
return $params; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment