Skip to content

Instantly share code, notes, and snippets.

@mgibbs189

mgibbs189/functions.php

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