Skip to:

Created private forum, but title is "Private: Private: Own Your Mission Forum"

  • drsheck


    Just named it “Own Your Mission”, understand if it needs to prefix it as “private”, but why twice?

    Using it on a Premise membership site with their plugin, but don’t think it’s that.

    Thoughts please?


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

  • Fee


    I’ve the same problem. Solved it by replacing the_title() with bbp_forum_title() on my theme’s page template – but that’s not a real solution, because the problem is in all tested themes (bp-default, twentytwelve) and needs some conditions to use it only with bbpress forums.



    The ‘Private: …’ is added by WP in wp-includes/post-template.php inside of the function get_the_title(). bbpress uses this function in it’s own function bbp_get_forum_title() to generate the title -> ‘Private:’ is appended first time. When the theme now calls the_title() ‘Private:’ is appended again.

    I adjusted bbp_get_forum_title() now: Add two filters, the first removes the ‘Private:’ from all Breadcrumbs and so on, the second appends ‘Private Forum:’ to the forum title.

    function bbp_get_forum_title( $forum_id = 0 ) {
    $forum_id = bbp_get_forum_id( $forum_id );
    add_filter( 'private_title_format', function(){ return '%s'; } );
    $title    = get_the_title( $forum_id );
    add_filter( 'private_title_format', function(){ return __( 'Private Forum: %s', 'bbpress' ); } );
    return apply_filters( 'bbp_get_forum_title', $title, $forum_id );

    Could one of the devs please take a look if this would be an option for you? I hardcoded it for now…

    You shouldn’t use antonymous functions (closures) for those filters. Those are only PHP 5.3+ compatible.

    What we could do instead of all those filters is getting the forum object and use the $forum->post_title field directly, instead of calling get_the_title on it’s ID. I imagine people who wants to modify forums titles tends to filter bbp_get_forum_title and not get_the_title



    Thanks, Daniel, sure you could do it with an own function instead.

    I saw that there is already a ticket related to the title:
    Didn’t test the patch yet.

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

You must be logged in to reply to this topic.