Created
July 7, 2012 16:30
-
-
Save ekka21/3067107 to your computer and use it in GitHub Desktop.
Wordpress: remove post meta box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (is_admin()) : | |
function my_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', 'my_remove_meta_boxes' ); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment