I searched through your forum and found “solutions” that are not working for me. I am trying to change the “Leave a Comment” text on the forms. Here is what I have at the moment:
add_filter( ‘gettext’, ‘translate_x_strings’, 20, 3 );
function translate_x_strings( $translated_text, $text, $domain ) {
$alt = get_option(‘eri_leave_comment_text’);
switch ( $translated_text ) {
case ‘Leave a Comment’ :
$translated_text = __( $alt, ‘x’ );
break;
}
return $translated_text;
}add_filter(‘comment_form_defaults’,‘eri_leave_comment_text’, 20 , 2);
function eri_leave_comment_text ($arg) {
$alt = get_option(‘eri_leave_comment_text’);
$arg[‘title_reply’] = __($alt);
return $arg;
}
The meta data changes just fine, and I have tested that the option text does get passed to the “comment_form_defaults” filter by using a JS alert. However, it is not changing the “title_reply”. I have tried adding “20, 2” to the filter, as well as “99”, as well as not adding a 3rd parameter. Nothing works.
Any suggestions?