PHP Language Switcher
-
Hello team,
What would be the best way to display a language switcher or the [language-switcher] shortcode via PHP?
I am outputting HTML in a PHP function, and it works to use
<?php echo do_shortcode(‘[language-switcher]’); ?>
But if I understand correctly, this is kind of silly because I’m already in the PHP environment. Can I just use a PHP TranslatePress variable instead, or a function? Something that would output the results of\wp-content\plugins\translatepress\partials\language-switcher-shortcode.php
Or a PHP variable that stores the shortcode?Cheers!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘PHP Language Switcher’ is closed to new replies.