Support » Alpha/Beta/RC » New installs: admin has user_level 0

  • MrPeteH


    On a fresh install of WordPress, the admin user begins with user_level == 0

    This seems rather serious to me.

    It’s easy to check:

    global $current_user;
        echo "level:".$user_level."<br />";

    This was not a problem in 2.3.3; it is a problem from 2.5 onward at least through the current trunk.

    All of my test systems have user level 10, so it somehow gets “fixed” after running a while. However, in the first week of my plugin’s use, I have had several reports that my plugin is broken, and I traced it down to this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • MrPeteH


    BTW, current_user_can('level_10') works fine.

    This is still an issue with WP 2.8.5. The default admin user does not have a “wp_user_level” field in the WP database created for him. I worked around it by adding that field to the wp_usermeta table:

    user_id 1
    meta_key wp_user_level
    meta_value 10

    This also fixes the problem with WordPress Email Notification Plugin v2.3.1 reporting a “Sorry, you must be logged in and at least a level 8 user to access admin setup” error after you install this plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘New installs: admin has user_level 0’ is closed to new replies.