Created
February 12, 2014 00:28
-
-
Save shadyvb/8947432 to your computer and use it in GitHub Desktop.
Change Like to Five! in P2 Likes plugin
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
/** | |
* 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