Specify the user level needed to skip comment moderation in WordPress
This simple WordPress hack allows you to specify the minimum user level needed to post comments without moderation. By default, WordPress allows administrators (and the author of the post) to skip moderation checks when posting comments, but it is easy to adjust this so that you can choose the user level yourself. This can be useful for those of you who have strict comment moderation enabled (manual comment approval), as it allows you to let registered users of your site post immediately without having to wait for approval.
Requirements
This code modification has been verified to work in WordPress versions 2.1 through 2.7+
Instructions
Open wp-includes/comment.php
Find the following code:
if ( $userdata && ( $user_id == $post_author || $user->has_cap('level_9')
) ) {
// The author and the admins get respect.
$approved = 1;
Then simply change level_9 to whatever user level you want. All users at or above the selected level will be able to post comments without requiring manual approval (if you have manual approval enabled).
For a complete list of the user levels, and their roles, please see this page from the WordPress codex: http://codex.wordpress.org/Roles_and_Capabilities



Jump to Comments