Last active
November 18, 2015 01:14
-
-
Save mauriciogofas/dfdbc95d9cca504093ee to your computer and use it in GitHub Desktop.
Translate text_domains
This file contains hidden or 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', 'theme_change_comment_field_names', 20, 3 ); | |
/** | |
* Change comment form default field names. | |
* | |
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
*/ | |
function theme_change_comment_field_names( $translated_text, $text, $domain ) { | |
if ( is_singular() ) { | |
switch ( $translated_text ) { | |
case 'Name' : | |
$translated_text = __( 'First Name', 'theme_text_domain' ); | |
break; | |
case 'Email' : | |
$translated_text = __( 'Email Address', 'theme_text_domain' ); | |
break; | |
} | |
} | |
return $translated_text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment