Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change subscription text

  • @enkoes

    Participant

    Hi, I’m using the code below to change text of topic subscription link (referring to this topic)

    add_filter ('bbp_before_get_topic_subscribe_link_parse_args' , 'change_topic_subscribe') ;
    
    function change_topic_subscribe ($args) {
    	$args['subscribe'] = 'Subscribe to this topic' ;
    	$args['unsubscribe'] = 'Unsubscribe' ;
    return $args ;
    }

    But it does not work in forum subscription text:

    add_filter ('bbp_before_get_forum_subscribe_link_parse_args' , 'change_forum_subscribe') ;
    
    function change_forum_subscribe ($args) {
    	$args['subscribe'] = 'Subscribe to this forum' ;
    	$args['unsubscribe'] = 'Unsubscribe' ;
    return $args ;
    }

    Anyone can guide me on this?

    Regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @robin-w

    Moderator

    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 ;
    }

    @enkoes

    Participant

    Thank you so much @robin-w!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar