Bug: disabling moderations
-
I tried to turn off moderation of comments with no luck. I had to go see the code and found out this:
FILE: wp-includes/function-post.php
ln 500:
if ( $userdata && ( $user_id == $post_author || $userdata->user_level >= 9 ) ) {
$approved = 1;
….
….and then it inserts $approved in the field ‘comment_approved’ of the table wp_comments (ln 513)
$userdata is retrieve this way:
ln 479:
$userdata = get_userdata($user_id);where get_userdata() retrieved the data of the user storaged in the table wp_users… which means that only users that have the field user_level >= 9 can publish comments without moderation but if you look at the file FILE wp_admin/users.php you’ll see that the user_level field will be 2 if the option ‘new_users_can_blog’ is selected.
Shouldn’t it this way?:
if ( $userdata && ( $user_id == $post_author || $userdata->user_level >= 2 ) ) {
$approved = 1;
….
….
- The topic ‘Bug: disabling moderations’ is closed to new replies.