try adding
//This function changes the text wherever it is quoted
function change_translate_text( $translated_text ) {
if ( $translated_text == 'old text' ) {
$translated_text = 'new text';
}
if ( $translated_text == 'old text2' ) {
$translated_text = 'new text2';
}
return $translated_text;
}
add_filter( 'gettext', 'change_translate_text', 20 );
to your functions file. The wording needs to be exact including caps and punctuation
Functions files and child themes – explained !
You can use this for custom subscribe text
//custom text for subscribe links
function rkk_subscribe_link() {
$args['subscribe'] = esc_html__( 'Subscribe to this', 'rkk' );
$args['unsubscribe'] = esc_html__( 'Unsubscribe to this', 'rkk' );
return $args;
}
add_filter('bbp_before_get_forum_subscribe_link_parse_args', 'rkk_subscribe_link' );
add_filter('bbp_before_get_topic_subscribe_link_parse_args', 'rkk_subscribe_link' );
Thanks for that. Works great with the exception of overwriting all instances of ‘subscribe’ rather than just on the one specific button.
@pamhsims
Use this code instead for what you want
//custom text for subscribe links
function rkk_forum_subscribe_link() {
$args['subscribe'] = esc_html__( 'Subscribe to this forum', 'rkk' );
$args['unsubscribe'] = esc_html__( 'Unsubscribe to this forum', 'rkk' );
return $args;
}
add_filter('bbp_before_get_forum_subscribe_link_parse_args', 'rkk_forum_subscribe_link' );
//custom text for topic subscribe links
function rkk_topic_subscribe_link() {
$args['subscribe'] = esc_html__( 'Subscribe to this topic', 'rkk' );
$args['unsubscribe'] = esc_html__( 'Unsubscribe to this topic', 'rkk' );
return $args;
}
add_filter('bbp_before_get_topic_subscribe_link_parse_args', 'rkk_topic_subscribe_link' );
@robkk I tried using your code, but it the topic subscribe links seem to not have any effect on the topic-level subscription links.
Yeah its weird how the topic subscribe links are having issues now??
According to this Trac entry, the bbp_before_get_topic_subscribe_link_parse_args function may be delayed until ver 2.7?
https://bbpress.trac.wordpress.org/ticket/2581