WordPress.org

Ready to get started?Download WordPress

Forums

bbPress Moderation
[resolved] [Plugin: bbPressModeration] Hide pending posts (5 posts)

  1. Prometheus Fire
    Member
    Posted 2 years ago #

    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?

    http://wordpress.org/extend/plugins/bbpressmoderation/

  2. ianhaycox
    Member
    Plugin Author

    Posted 2 years ago #

    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.

    Ian.

  3. presspressperson
    Member
    Posted 2 years ago #

    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.

  4. Shivanand The Designer
    Member
    Posted 1 year ago #

    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;
    	}
  5. martinofmoscow
    Member
    Posted 1 year ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic