WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to remove "Site admin" link depending on user level? (3 posts)

  1. croila
    Member
    Posted 7 years ago #

    Hi,

    I've searched all over for the answer to this, but I can't find it anywhere - apologies if I've missed something.

    I have another WP site where I need to have users logging in to read certain (but not all) news articles/posts, and they will have the absolutely lowest user level.

    I really don't want these guys to go into "site admin" at all, and from the login screen, I've hacked wp-login.php so they are taken straight to the main index.php and don't see the Control Panel at all.

    Is there any way that when they're logged in and can read the posts they're supposed to, the "site admin" link can be invisible? So they therefore can't get into the Control Panel at all?

    However, for higher level users, such as Admin, I WOULD like the "site admin" link to appear.

    I'm sorry, my PHP knowledge is rubbish and I'm not sure how to approach this, so if anyone could help me I'd be ever so grateful.

    Oh, and I'm using WP 2.0, I should say.

    Kind regards,
    Croila

  2. croila
    Member
    Posted 7 years ago #

    Oooh, I've done it.

    Just stick this in on your sidebar right after <?php wp_register(); ?>:

    <?php global $user_ID;
    get_currentuserinfo();
    if(user_can_edit_post($user_ID,$post->ID)) {
    wp_register();
    }
    ?>

    Well, it works for me anyway :-)

  3. pixelgeek
    Member
    Posted 7 years ago #

    Why is this enabled by default?

Topic Closed

This topic has been closed to new replies.

About this Topic