How to use fb_locale filter?
-
I’d like to load FB scripts with correct locale (language is set by user, i’m using WPML plugin).
First of all i changed og:lang meta tag:
function myfunc_ogp_filter( $meta_tags ) { $meta_tags[ 'https://ogp.me/ns#locale' ] = ICL_LANGUAGE_CODE.'_'.strtoupper(ICL_LANGUAGE_CODE); return $meta_tags; } add_filter( 'fb_meta_tags', 'myfunc_ogp_filter' );
And it works fine, but I don’t know how to change locale using fb_locale filter. I tried:
function myfunc_set_locale() { return ICL_LANGUAGE_CODE.'_'.strtoupper(ICL_LANGUAGE_CODE); } add_filter('fb_locale', 'myfunc_set_locale');
But it doesn’t work.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to use fb_locale filter?’ is closed to new replies.