Created
February 13, 2014 13:20
-
-
Save natejones/8974904 to your computer and use it in GitHub Desktop.
WordPress Custom UI
This file contains 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
//*********************** | |
// | |
// CUSTOMIZE UI | |
// | |
//*********************** | |
// remove some metaboxes | |
function remove_post_custom_fields() { | |
remove_meta_box('postexcerpt', 'post', 'normal'); // removes excerpt metabox | |
remove_meta_box('trackbacksdiv', 'post', 'normal'); // removes trackbacks metabox | |
remove_meta_box('commentstatusdiv', 'post', 'normal'); // removes discussion metabox | |
remove_meta_box('postcustom', 'post', 'normal'); // removes custom metaboxes (other than defined here) | |
remove_meta_box('commentsdiv', 'post', 'normal'); // removes comments metabox | |
//remove_meta_box('revisionsdiv', 'post', 'normal'); // removes revision metabox | |
remove_meta_box('authordiv', 'post', 'normal'); // removes author metabox | |
//remove_meta_box('sqpt-meta-tags', 'post', 'normal'); // removes metabox | |
remove_meta_box('categorydiv', 'post', 'normal'); // removes categories metabox | |
//remove_meta_box('slugdiv', 'post', 'normal'); // removes slugs metabox | |
remove_meta_box('formatdiv', 'post', 'normal'); // removes formats metabox | |
//remove_meta_box('tagsdiv-post_tag', 'post', 'normal'); // removes tags metabox | |
remove_meta_box('pageparentdiv', 'post', 'normal'); // removes attributes metabox | |
} | |
add_action( 'admin_menu' , 'remove_post_custom_fields' ); | |
// remove some customization options for admins | |
if (current_user_can('manage_options')) { | |
add_action( 'admin_menu', 'admin_remove_menu_pages' ); | |
} | |
function admin_remove_menu_pages() { | |
// | |
//remove_menu_page( 'edit.php' ); // Posts | |
//remove_menu_page( 'upload.php' ); // Media | |
remove_menu_page( 'link-manager.php' ); // Links | |
remove_menu_page( 'edit-comments.php' ); // Comments | |
//remove_menu_page( 'edit.php?post_type=page' ); // Pages | |
//remove_menu_page( 'plugins.php' ); // Plugins | |
//remove_menu_page( 'themes.php' ); // Appearance | |
//remove_menu_page( 'users.php' ); // Users | |
//remove_menu_page( 'tools.php' ); // Tools | |
//remove_menu_page('options-general.php'); // Settings | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment