Created
June 19, 2014 15:45
-
-
Save Pross/00f3cf95ed6accdcce5d to your computer and use it in GitHub Desktop.
nav_logo filter
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
<?php | |
// we are going to filter navbar_logo section option on the fly.. | |
add_filter( 'pl_opt-navbar_logo', 'change_logo_on_lang' ); | |
function change_logo_on_lang( $val ) { // $val is the value of the setting. | |
// use some polylang data to get current language | |
global $curlang; | |
$curlang = $this->curlang->slug; | |
// asumming the slug is nl or en | |
if( 'en' == $curlang ) | |
return 'http://some-image-for-nl.png'; | |
else | |
return 'http://some-image-for-en.png'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment