Skip to:
Content
Pages
Categories
Search
Top
Bottom

Way to prevent duplicate post blocking?

  • @bhkh

    Participant

    Is there a way to disable the “Duplicate reply detected” error checking? My forum will mostly be people uploading audio attachments and they may very well just say the same thing each time they post. But in the short term it’s a bother to my testers since they can’t just write “test” each time.

    I know that the error code is in \wp-content\plugins\bbpress\includes\common\functions.php

    I’m guessing there is some way to filter the bbp_check_for_duplicate function, but I don’t know enough php to do that.

    I’ve seen some others post this question in the past but didn’t see answers.

    (BTW, I posted this question a few hours ago but it got marked as spam. Not sure why. I included some code in it but have removed it in this one. Hope it’s ok to repost.)

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

    Moderator

    the easiest way to do this is to allow participant to ‘throttle’ – this then lets them bypass this check

    so the code (untested) should be :

    add_filter( 'bbp_get_caps_for_role', 'rew_throttle_bypass', 10, 2);
    
    function rew_throttle_bypass ($caps, $role) {
    	if ($role == bbp_get_participant_role() ) {
    		$caps['throttle'] = true ;
    	}
    return $caps ;
    }

    ut 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

    @bhkh

    Participant

    Thanks!

    It seems that for an admin/moderator user this works. But for a regular subscriber/participant it still blocks duplicates.

    I kind of understand what the code is doing but not enough to understand why it’s not working. It doesn’t seem to be saying what role is allowed to bypass. Was I supposed to do something with this:

    the easiest way to do this is to allow participant to ‘throttle’

    I don’t see a setting for that. Could you explain more what I should do to allow participants to throttle?

    @robin-w

    Moderator

    line 309 of includes/replies/functions calls a function calledbbp_check_for_duplicate within the bbp_new_reply_handler function

    That function checks for duplicates and is in includes/common/functions line 663

    within that function line 676 for a check

    if ( user_can( (int) $r['post_author'], 'throttle' ) ) {
    		return true;
    	}

    so allowing participants to throttle allows duplicates

    It is a bit of a fudge, but should work !!

    @bhkh

    Participant

    Hmm. The code given in your first reply doesn’t seem to work. Subscribers/Participants still get the error message, “Error: Duplicate reply detected; it looks as though you’ve already said that.”

    I have removed all other php and disabled plugins.

    Ideas?

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