Skip to content

Instantly share code, notes, and snippets.

@WebEndevSnippets
Created March 19, 2014 19:38
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 WebEndevSnippets/9649582 to your computer and use it in GitHub Desktop.
Save WebEndevSnippets/9649582 to your computer and use it in GitHub Desktop.
Soliloquy: White label Soliloquy slider
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