Skip to content

Instantly share code, notes, and snippets.

@jamesbryant
Created June 5, 2013 23:32
Show Gist options
  • Save jamesbryant/5718160 to your computer and use it in GitHub Desktop.
Save jamesbryant/5718160 to your computer and use it in GitHub Desktop.
Remove Admin Cruft for Editors
//
// Remove Admin Cruft for Editors
//
if (is_admin()) {
function bry_remove_meta_boxes() {
if(!current_user_can('administrator')) {
remove_meta_box('linktargetdiv', 'link', 'normal');
remove_meta_box('linkxfndiv', 'link', 'normal');
remove_meta_box('linkadvanceddiv', 'link', 'normal');
remove_meta_box('postexcerpt', 'post', 'normal');
remove_meta_box('trackbacksdiv', 'post', 'normal');
remove_meta_box('commentstatusdiv', 'post', 'normal');
remove_meta_box('postcustom', 'post', 'normal');
remove_meta_box('commentstatusdiv', 'post', 'normal');
remove_meta_box('commentsdiv', 'post', 'normal');
remove_meta_box('revisionsdiv', 'post', 'normal');
remove_meta_box('authordiv', 'post', 'normal');
remove_meta_box('sqpt-meta-tags', 'post', 'normal');
}
}
add_action( 'admin_menu', 'bry_remove_meta_boxes' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment