Support » Plugin: bbPress Moderation » [Plugin: bbPressModeration] Hide pending posts

  • Resolved Prometheus Fire


    Since bbpress hides posts that are in the trash, would it be possible to hide also pending posts?

    We’ve all seen this message: This forum contains 13 topics (+ 2 hidden) and 36 replies,

    Would it be possible to add the pending posts to that so that we don’t get the big (Awaiting Moderation) tag on several posts displayed to all the users who visit?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ianhaycox


    I’ll have a look, but I suspect the handling of Trash and the hidden count is in bbPress core and there may not be any filters/actions to hook into.


    I used css to hide topics with the following rule:

    tr.topic.status-pending { display:none; }

    You can do the same thing with posts, but unfortunately, the post header will remain since it’s a separate tr that doesn’t include the class “status-pending.”

    tr.reply.status-pending { display:none; }

    You could probably use ajax to grab the tr just before each tr.reply.status-pending and give it an inline style of display:none; but that is not my area of expertise.

    Also, your # of posts and topics will be incorrect (as in “Viewing 2 posts – 1 through 2 (of 2 total)“) unless you update the logic. I hide those too because I feel like they just add clutter to the page, and most of those numbers are already in the “notice” section. You can do that easily with css as well:

    div.bbp-pagination-count { display:none; }

    If your forum is paged your pages might end up being a few topics/replies short of the max per page, and you could end up with empty pages since the pagination is still counting the hidden topics/replies. Setting the topics/replies per page # to something high and staying on top of approval/deletion will minimize that.

    The method isn’t perfect, but it gets the job done quick and easy without any functionality issues.

    I’d be interested to hear a back end solution to this. In my humble opinion, showing pending topics almost defeats the purpose since you can still read the name of the topic.

    At line 150 (version 1.4) try this: should only make pending visible for moderators and above.

    function query($bbp) {
    		if (!bbp_is_query_name( 'bbp_widget' ) && current_user_can('moderate')) {
    			$bbp['post_status'] .= ',pending';
    		return $bbp;

    Thanks @varun21 for that, it works well. But shouldn’t this be the standard behaviour? Isn’t the entire point of moderation that posts AREN’T VISIBLE until moderated?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: bbPressModeration] Hide pending posts’ is closed to new replies.