Support » Fixing WordPress » $user_level for admin account returned as 0?

  • Resolved SteelFrog

    (@steelfrog)


    Hey there, folks.

    I’m trying to write a short condition-based sidebar menu for my blog. I’m trying to add a few options only available to user accounts level 1 and up. While it works fine for all other accounts, my admin account returns a value of 0 when I call $user_level.

    Here’s how I get the value:
    <?php global $user_ID, $user_email, $user_identity, $user_level; ?>

    I then use that value here:
    <?php if ( $user_level >= 1 ) : ?>

    I checked the user_level by doing a simple print. Any ideas why the admin account returns as 0 rather than 9 (or is it 10?)

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘$user_level for admin account returned as 0?’ is closed to new replies.