Remove or Hide Admin Menu Links for Certain or Specific Users or Roles
The following snippet will let you remove as well as hide admin menu links for certain users or role.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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 } } |
Source: Snipplr
Get all media attached to a post
The following snippet will allow you to get all