Created
March 19, 2014 19:38
-
-
Save WebEndevSnippets/9649582 to your computer and use it in GitHub Desktop.
Soliloquy: White label Soliloquy slider
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
add_filter( 'gettext', 'tgm_soliloquy_whitelabel', 10, 3 ); | |
/** | |
* White label Soliloquy slider | |
* Change all instances of Soliloquy to 'Slider' | |
*/ | |
function tgm_soliloquy_whitelabel( $translated_text, $source_text, $domain ) { | |
// If not in the admin, return the default string. | |
if ( ! is_admin() ) { | |
return $translated_text; | |
} | |
if ( strpos( $source_text, 'Soliloquy Slider' ) !== false ) { | |
return str_replace( 'Soliloquy Slider', 'Slider', $translated_text ); | |
} | |
if ( strpos( $source_text, 'Soliloquy Sliders' ) !== false ) { | |
return str_replace( 'Soliloquy Sliders', 'Sliders', $translated_text ); | |
} | |
if ( strpos( $source_text, 'Soliloquy slider' ) !== false ) { | |
return str_replace( 'Soliloquy slider', 'slider', $translated_text ); | |
} | |
if ( strpos( $source_text, 'Soliloquy' ) !== false ) { | |
return str_replace( 'Soliloquy', 'Slider', $translated_text ); | |
} | |
return $translated_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment