• Resolved daffulip

    (@daffulip)


    Sorry for bothering the board, but I can’t find the answer (I bet it’s there!).

    In the sidebar of a template I want to show a “menu item” if and only if the user is logged in and has administrator rights.

    What is the question that have to ask in the PHP if-statement?

    THX

Viewing 1 replies (of 1 total)
  • Thread Starter daffulip

    (@daffulip)

    Solved it on my own. I am not sure whether this solution is the best, but I did it so:

    <?php global $userdata;
    get_currentuserinfo();
    if ($userdata->user_level == 10) {
    echo('<li>Ciao ' . $userdata->user_login . '</li>');
    echo('<li><a href="http://xxx/wp-admin/post.php">New entry</a></li>');
    echo('<li><a href="http://xxx/wp-admin/page-new.php">New page</a></li>');
    }
    ?>

    Bye!

Viewing 1 replies (of 1 total)

The topic ‘Conditional menu: if Having_Admin_Rights()’ is closed to new replies.