Skip to content

Instantly share code, notes, and snippets.



Last active Oct 6, 2017
What would you like to do?
Pass the language code when preloading (WPML, Polylang)
// 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
You can’t perform that action at this time.