PHP filter pll_custom_flag
-
Hi, I am using custom .svg images as flags.
https://polylang.pro/doc/can-i-use-my-own-flags-for-the-language-switcher/
I want to specify the height and widh of custom SVG flags by using the PHP filter pll_custom_flag.
https://polylang.pro/doc/filter-reference/#pll_custom_flag
add_filter( ‘pll_custom_flag’, ‘pll_custom_flag’, 10, 2 );
function pll_custom_flag( $flag, $code ) {
$flag[‘url’] = “https://mysite.com/wordpress/wp-content/polylang/{$code}.svg”;
$flag[‘width’] = 32;
$flag[‘height’] = 22;
return $flag;
}The filter does not work.
I have changed the URL and directory to my own.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘PHP filter pll_custom_flag’ is closed to new replies.