• I am trying to figure out if there is a way to disable a particular part of the post/page editor. Lets say i want to hide or just disable (aka, no edit) the Discussion field or maybe the Excerpt field, etc. Any ideas how i might do this? I want to do itthrough code, obviously i know i can just minimize those fields, but i am looking for more control than that.

Viewing 1 replies (of 1 total)
  • add_action( 'do_meta_boxes', 'macscr_remove_meta_boxes' );
    
    function macscr_remove_meta_boxes( $post_type ) {
    	if ( 'post' == $post_type )
    		remove_meta_box( 'commentstatusdiv', $post_type, 'normal' );
    
    	if ( 'page' == $post_type )
    		remove_meta_box( 'postexcerpt', $post_type, 'normal' );
    }

    It’s basically the reverse of add_meta_box().

Viewing 1 replies (of 1 total)
  • The topic ‘disable post/page field through plugin or theme?’ is closed to new replies.