I'm running the following code:
add_filter('locale', 'set_my_locale');
function set_my_locale( $lang ) {
$lang = "de";
echo 'test';
return $lang;
}
This is returning the correct 'de' language, but it is echoing out the 'test' 5 times.
Why is it echoing the 'test' 5 times?
The reason that I have the echo 'test'; in there is because I want to do some other checks in this function but it seems to run 5 times for some reason.