Created
January 26, 2015 23:37
-
-
Save montrealist/643fb8584c64b64d8a83 to your computer and use it in GitHub Desktop.
A filter allowing to output a shorter language slug instead of a language name in Polylang plugin on WordPress.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put this in functions.php: | |
if ( ! function_exists( 'tco_switcher_language_name' ) ) : | |
function tco_switcher_language_name($args = '') { | |
$args['display_names_as'] = 'slug'; | |
return $args; | |
} | |
add_filter('pll_the_languages_args','tco_switcher_language_name'); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment