Get the correct locale during ajax refreshes

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

/**
* Add to your (child) theme’s functions.php
* Requires https://facetwp.com/add-ons/multilingual/
*/
function fwp_get_locale() {
if ( function_exists( ‘FWP’ ) && ! empty( $_POST[‘data’][‘http_params’][‘lang’] ) ) {
return $_POST[‘data’][‘http_params’][‘lang’];
}
return get_locale();
}

{{/gist}}