Skip to content

Instantly share code, notes, and snippets.

@shadyvb
Created February 12, 2014 00:28
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 shadyvb/8947432 to your computer and use it in GitHub Desktop.
Save shadyvb/8947432 to your computer and use it in GitHub Desktop.
Change Like to Five! in P2 Likes plugin
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function p2_like2five( $translated_text, $text, $domain ) {
if ( 'p2-likes' != $domain ) {
return $translated_text;
}
switch ( $text ) {
case 'Like' :
$translated_text = __( 'Five!', 'p2-likes' );
break;
case 'Unlike' :
$translated_text = __( 'Unfive!', 'p2-likes' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'p2_like2five', 20, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment