Skip to content

Instantly share code, notes, and snippets.

@Pross
Created June 19, 2014 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pross/00f3cf95ed6accdcce5d to your computer and use it in GitHub Desktop.
Save Pross/00f3cf95ed6accdcce5d to your computer and use it in GitHub Desktop.
nav_logo filter
<?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