Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get rid of "Private: " text in front of forum Title

  • I’m setting up a site that wants a forum just for registered users.
    How can I get rid of that pesky “private:” indicator in front of the forum title? I’ve searched all files far and wide and haven’t found anything.

    Please help 🙂

Viewing 10 replies - 1 through 10 (of 10 total)

  • John James Jacoby
    Keymaster

    @johnjamesjacoby

    It’s a WordPress core issue, and one I’m not sure we can easily filter out. I’ll take another look at this for 2.2, but I think it’s hard-coded in.

    Hmm, not great but thanks for the info.

    Expanding my search to include all of WordPress resulted in this fine code I just plop in to my functions.php that’ll remove it:

    function the_title_trim($title) {
    // Might aswell make use of this function to escape attributes
    $title = attribute_escape($title);
    // What to find in the title
    $findthese = array(
        '#Protected:#', // # is just the delimeter
        '#Private:#',
        '#Privat:#'
    );
    // What to replace it with
    $replacewith = array(
        'a', // What to replace protected with
        'b' // What to replace private with
    );
    // Items replace by array key
    $title = preg_replace($findthese, $replacewith, $title);
    return $title;
    

    }
    add_filter(‘the_title’, ‘the_title_trim’);

    Credit: https://wordpress.org/support/topic/how-to-remove-private-from-private-pages?replies=24


    John James Jacoby
    Keymaster

    @johnjamesjacoby

    Nice tip. I’m unsure we’ll use such a brute force method since we’ll only want to apply this to bbPress titles, but good to know it’s possible. Though, it’d be better to avoid it being added at all.


    imagei
    Participant

    @imagei

    Hey John,
    I’m facing the exact same problem and wondering if you reviewed it in 2.2? Is there a less brutal method of removal?


    royho
    Participant

    @royho

    Yes there is a less brutal method…Instead of targeting all WP titles, you can target only bbPress titles.

    Filter on ‘bbp_get_forum_title’ and ‘bbp_get_forum_archive_title’


    imagei
    Participant

    @imagei

    Great, thanks Royho.


    drsheck
    Participant

    @drsheck

    My problem with this is my forum title shows up as Private: Private” forum title. Posted in a separate thread on how to eliminate the double or even why it’s there, but open to help from anybody here, too.
    Thanks,
    Adam


    Fee
    Participant

    @wdfee

    I posted a solution adding a filter to `’private_title_format’ here: https://bbpress.org/forums/topic/created-private-forum-but-title-is-private-private-own-your-mission-forum/#post-131731
    `

    The ‘Private Forum’ appendix could then be replaced by using a language file, e.g.


    cliffrohde
    Participant

    @cliffrohde

    I have a better than layman’s grasp of code, but not much better. Have read multiple threads. Is there an easy way to resolve the “Private: Private:” issue? I’d prefer there to be no “private” at all even though the forum is in fact private.

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