/ Published in: PHP
In this example I used the "Members" plugin to add a capability called "hide_jobs" and that was the trigger to hide certain admin menus and also hide the "Right Now" dashboard widget.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if (current_user_can('hide_jobs')) { add_action( 'admin_menu', 'my_remove_menu_jobs' ); function my_remove_menu_jobs() { remove_menu_page('edit.php?post_type=job'); remove_menu_page('edit.php?post_type=solution'); remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); // right now } }