WordPress.org

Forums

Remove Dashboard Access
[resolved] Remove access to About WordPress menu item (3 posts)

  1. stevephome
    Member
    Posted 2 years ago #

    Hi Drew,

    Great plugin! Did a bit of searching and was glad to have found it. Does the trick.

    Quick ques - is there a way to remove the little About WordPress menu as well? (I am v.new to WP and can't code so excuse my ignorance!)

    Thanks, Steve.

    http://wordpress.org/extend/plugins/remove-dashboard-access-for-non-admins/

  2. Drew Jaynes
    4.2 Release Lead
    Plugin Author

    Posted 2 years ago #

    Hi Steve,

    You can use what's called a filter to add toolbar menus to the excluded list.

    Side note: The way a filter works, is it takes an existing value or group of values (in this case a group of values), and lets you modify it before passing it back to WordPress. So what we need to do here is take that group, add in the id for the About WordPress menu (wp-logo) and then pass it back to WordPress.

    If you add following to your theme's functions.php file, it will hide the WordPress logo menu from the front-end for disallowed users:

    function steve_hide_wplogo_menu( $nodes ) {
    	$nodes[] = 'wp-logo';
    	return $nodes;
    }
    add_filter( 'rda_frontend_toolbar_nodes', 'steve_hide_wplogo_menu' );

    If you also want to hide it when disallowed users are in the Dashboard, add this just below the code from above:

    add_filter( 'rda_toolbar_nodes', 'steve_hide_wplogo_menu' );

    Hope that helps.

  3. stevephome
    Member
    Posted 2 years ago #

    Awesome! Thanks Drew. (I know what I am doing this weekend...crash course in WordPress dev ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Remove Dashboard Access
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.