Customize the post edit screen

Customizing the post editing screen can be very helpful when creating a clients website. With custom meta boxes and meta data clients can feel good about adding, editing and publishing content. Additionally you can remove meat boxes or even the post editor all together. Slimming down the post editing screen can cut down on confusion for the client when going to create new content.


[php]
/**
* Hide editor on specific pages.
*
*/
add_action( ‘admin_init’, ‘hide_editor’ );

function hide_editor() {
// Get the Post ID.
$post_id = $_GET[‘post’] ? $_GET[‘post’] : $_POST[‘post_ID’] ;
if( !isset( $post_id ) ) return;

// Hide the editor on the page titled ‘Homepage’
$homepgname = get_the_title($post_id);
if($homepgname == ‘Homepage’){
remove_post_type_support(‘page’, ‘editor’);
}

// Hide the editor on a page with a specific page template
// Get the name of the Page Template file.
$template_file = get_post_meta($post_id, ‘_wp_page_template’, true);

if($template_file == ‘template-service-page.php’){ // the filename of the page template
remove_post_type_support(‘page’, ‘editor’);
}
}

[/php]