Skip to content

Instantly share code, notes, and snippets.

@garvs
Created March 5, 2018 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garvs/400cab01a7217cb3c7b44723190fdf11 to your computer and use it in GitHub Desktop.
Save garvs/400cab01a7217cb3c7b44723190fdf11 to your computer and use it in GitHub Desktop.
Hide WP Logo from admin bar menu additional role option
/**
* This code adds additonal option to the Users->User Role Editor,
* which allows to hide WordPress Logo menu from admin bar menu for the selected role
**/
add_filter('ure_role_additional_options', 'ure_hide_wp_logo_role_option', 10, 1);
function ure_hide_wp_logo_role_option($items) {
$item = URE_Role_Additional_Options::create_item('hide_wp_logo', esc_html__('Hide WP Logo from admin menu bar', 'user-role-editor'), 'admin_bar_menu', 'hide_wp_logo_admin_bar_menu');
$items[$item->id] = $item;
return $items;
}
function hide_wp_logo_admin_bar_menu($wp_admin_bar) {
$wp_admin_bar->remove_node('wp-logo');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment