[Solved] How to force topic/post moderation according to a user metadata
I need to force every topic/post as unapproved according to some user metada (some user have a "child" metata and I need to force moderation for them).
Is there a way to do that ? I'm quite new to Wordpress development but I'm experienced with PHP.
Maybe au hook or a fllter ?
If I can't do that based on a metadata, is there a way to do that from the user group/role ?
Thank you for any help 🙂
I'm really sorry, but there is no hook for this purpose.
However, your issue can be solved in the following way:
1. Create a new usergroup called for example require_moderation.
2. Enable all necessary CANs, just keep the "Can pass moderation" disabled. In this case, all posts will become unapproved.
3. Check and make sure the right Forum access is assigned to the require_moderation usergroup in the "Forum permission" section.
4. Change the usergroup of the current user to require_moderation.
This is a good approach as far as there can be other users, whose posts you'd prefer to moderate or probably in future you'll trust the user and want the user's posts do not require moderation. In this case, you'll just need to change usergroup of the user instead of using additional codes.