Skip to content

Instantly share code, notes, and snippets.

@mauriciogofas
Last active November 18, 2015 01:14
Show Gist options
  • Save mauriciogofas/dfdbc95d9cca504093ee to your computer and use it in GitHub Desktop.
Save mauriciogofas/dfdbc95d9cca504093ee to your computer and use it in GitHub Desktop.
Translate text_domains
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