Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide “You must be logged in to create new topics” in private forum

  • @enkoes

    Participant

    Hi, good days!

    I wish to hide the message “You must be logged in to create new topics” in ONE of my forum. But leaving other forums UNTOUCHED.

    Reason is that this particular forum is set as a private forum. Participants are not allowed to create new topics (but only can view its content) even though they log in. So this message looks a bit misleading for them.

    I already created a BBpress child theme. Pls show me how to do this. Thanks!

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

    Moderator

    bbp style pack

    once activated go to

    dashboard>settings>bbp style pack>Topics Index Styling>item 17

    @enkoes

    Participant

    Hi Robin,

    I wonder how should this change only affect one forum and not across all other forums? I just want to delete the message in ONE private forum only.

    Best Regards

    @robin-w

    Moderator

    sorry, late in the day when I looked at this. change the forum id and text you want below to the one you want. if you want it blank, then $translated_text = ''

    add_filter( 'gettext', 'rew_change_must_be_text', 30, 3 );
    
    function rew_change_must_be_text( $translated_text, $text, $domain ) {
    	if ( $text == 'You must be logged in to create new topics.' && bbp_get_forum_id() == 2927 ) {
    		$translated_text = 'new text here' ;
    	}
    	return $translated_text ;
    }

    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

    @enkoes

    Participant

    Hi Robin, where do I specify the FORUM ID in the codes given?

    @robin-w

    Moderator

    in this part

    bbp_get_forum_id() == 2927

    so for your forum, go to

    dashboard>forums>all forums and select ‘edit’ of the forum you want

    At the top of your browser in the url bat you will see

    http://mysite.com/wp-admin/post.php?post=2927&action=edit

    2927 is the number of that forum, in my case 2927

    @enkoes

    Participant

    Hi, it works like a charm!

    Thanks for yr prompt reply. 🙂

    @robin-w

    Moderator

    🙂

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