untested, but this should work
add_filter ('bbp_before_get_topic_subscribe_link_parse_args' , 'change_subscribe') ;
function change_subscribe ($args) {
$args['subscribe'] = 'Watch' ;
$args['unsubscribe'] = 'Unwatch' ;
return $args ;
}
Put this in your child theme’s function file –
ie wp-content/themes/%your-theme-name%/functions.php
where %your-theme-name% is the name of your theme
or use
Code Snippets
Thanks, the code works however only when loading onto the page. When I click to either ‘Watch’ or ‘Unwatch’ the text reverts back to ‘Unsubscribe’ or ‘Subscribe’ until I refresh the page again.
ok, try this
add_filter( 'gettext', 'rew_change_text', 20, 3 );
//This function changes the text wherever it is quoted
function rew_change_text( $translated_text, $text, $domain ) {
if ( $text == 'Subscribe' ) {
$translated_text = 'Watch';
}
if ( $text == 'Unsubscribe' ) {
$translated_text = 'Unwatch';
}
return $translated_text;
}
great – glad you are fixed !!
The way subscriptions works has changed
use this code now :
add_filter ('bbp_before_get_user_subscribe_link_parse_args' , 'change_subscribe') ;
function change_subscribe ($args) {
$post_id = $args['object_id'] ;
if (bbp_is_topic( $post_id )) $text = 'topic' ;
if (bbp_is_forum( $post_id )) $text = 'forum' ;
$args['subscribe'] = 'Subscribe to this '.$text ;
$args['unsubscribe'] = 'Unsubscribe' ;
return $args ;
}