1
votes

I have a WordPress site. There are many users. I want when an author logs in, the author who currently is currently logged on couldn't access the "edit page" menu in the admin bar.

Is there any plugin to disable that?

2
Do you want to remove the bar, or the entire privilege to edit pages? Who should be able to edit pages then, just administrators?Pekka
No, I want it for admin, but not for the author user.Ranjit
In other words you want to lock the ability to post and perform any changes.bahrep

2 Answers

1
votes

You can use this plugin :

http://wordpress.org/extend/plugins/admin-bar-disabler/

OR Alternative and manual way is under if condition place this

show_admin_bar(false);

E.g.

if(!is_admin())
{
    show_admin_bar(false);
}

place this code in functions.php so that it will disable the admin bar for all the other users.

1
votes

In your functions.php file, you can add one of the following code snippets to get the indicated results:

// Only display to administrators

add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
        show_admin_bar(false);
    }
}

// Disable for specific role (in this case, 'subscriber')

function remove_admin_bar() {
    $user = wp_get_current_user();

    if (in_array(‘subscriber’, $user->roles)) {
        show_admin_bar(false);
    }
}