Hello.
We force registration for all our forum users. When someone registers they are assigned to a usergroup that we created that is associated to the Subscriber WP user role. When a user creates a post, it is published immediately and is not held for moderation. We would like all posts to be held for moderation.
Under the Usergroups settings this particular usergroup has the Front - Can pass moderation box unchecked so it is not behaving as expected.
Is there another setting I may be missing to force moderation for all posts? Does the fact that the user is logged in publish their posts without moderation?
We have extensive WP coding experience so if there are hooks we can take advantage of to accomplish this, please suggest the proper hook and/or please point us to some documentation that may help.
Thank you.
Hi @gar1
Dashboard > wpForo > Settings > Spam Protection > Posts must be manually approved
Thank you for the suggestion but we already have that enabled.
Do you know if moderation rules are ignored when the user has an account and is logged in?
User is New (under hard spam control) during first [X] posts
[X]
what value are you using
5
10
100
1000
10000
or
0
I started looking into the plugin code and I discovered a function called auto_moderate in the Moderation class. It seems to be doing the checks for whether or not a post needs to be moderated.
It is checking the user's usergroup and looking for can( 'em' ) or can( 'aup' ) and setting the item status accordingly. Seems like status set to 1 forces moderation.
In the database this particular usergroup has the following json stored...
a:37:{s:2:"mf";i:0;s:2:"ms";i:0;s:2:"mt";i:0;s:2:"vm";i:0;s:3:"aum";i:0;s:3:"vmg";i:0;s:2:"mp";i:0;s:3:"mth";i:0;s:2:"em";i:1;s:2:"bm";i:0;s:2:"dm";i:0;s:3:"aup";i:0;s:9:"view_stat";i:1;s:4:"vmem";i:1;s:4:"vprf";i:1;s:4:"vpra";i:1;s:4:"vprs";i:0;s:3:"upc";i:1;s:3:"upa";i:1;s:3:"ups";i:1;s:2:"va";i:1;s:3:"vmu";i:0;s:3:"vmm";i:0;s:3:"vmt";i:1;s:4:"vmct";i:1;s:3:"vmr";i:1;s:3:"vmw";i:1;s:4:"vmsn";i:1;s:4:"vmrd";i:1;s:3:"vml";i:1;s:3:"vmo";i:1;s:3:"vms";i:1;s:4:"vmam";i:1;s:4:"vwpm";i:1;s:3:"caa";i:1;s:12:"vt_add_topic";i:1;i:0;s:0:"";}
You can see the value of em is 1 and in auto_moderate finds the value of 1 for em and sets the status to 0 thus allowing immediate publication.
This is my basic understanding but I'd be happy for you to clarify if I have it wrong.
Is this correct? What setting causes the system to store em to 1 in the database? What does em stand for and what does aup stand for?
If I want to force all posts and replies to be queued for moderation I was thinking of overriding this function in our child theme and returning status = 1 always. Does that sound like sound logic? Since I do not see any hooks here, would overriding the function in our child theme be problematic with WPForo plugin updates?
I would greatly appreciate it if you can answer my questions.
Thank you.