Pass the language code when preloading (WPML, Polylang)

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?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;
} );

{{/gist}}