Skip to content

Instantly share code, notes, and snippets.

@tobedoit
Created November 26, 2012 07:04
Show Gist options
  • Save tobedoit/4146957 to your computer and use it in GitHub Desktop.
Save tobedoit/4146957 to your computer and use it in GitHub Desktop.
Wordpress: remove post write panel features
/* Remove page and post write panel features **********************************************************************
** http://wpmu.org/remove-page-and-post-write-panel-features/ *****************************************************
** http://wordpress.stackexchange.com/questions/2025/removing-metabox-for-slug-without-removing-functionality ** */
/* !관리자외 글쓰기 패널 삭제 *************************************************************************************** */
add_action('admin_init', 'my_custom_write_panel');
function my_custom_write_panel() {
//if ( !current_user_can( 'delete_others_posts' ) ) { // if user is below Editor level
//if ( !current_user_can( 'manage_options' ) ) { // if user is below Administrator level
remove_post_type_support( 'post', 'excerpt' );
remove_post_type_support( 'post', 'custom-fields' );
remove_post_type_support( 'post', 'trackbacks' );
//remove_post_type_support( 'post', 'author' );
remove_post_type_support( 'post', 'thumbnail' );
remove_post_type_support( 'post', 'revisions' );
remove_meta_box('slugdiv', 'post', 'normal');
remove_meta_box('formatdiv', 'post', 'normal');
remove_meta_box('commentsdiv', 'post', 'normal');
remove_meta_box('tagsdiv-post_tag', 'post', 'normal'); // to remove 'Tags' metabox
//}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment