Is this possible to do somehow?
In some pages i use a custom box plugin and i don’t need to show the content box on some of those pages. Is it possible to hide it by page template? Or ID if template is not possible?
4 Answers
I ended up using userabuser’s answer with a small modification, because global $post doesn’t seem to exist on init. You can instead just query for post
in querystring, like so:
function remove_editor() {
if (isset($_GET['post'])) {
$id = $_GET['post'];
$template = get_post_meta($id, '_wp_page_template', true);
if($template == 'template_name.php'){
remove_post_type_support( 'page', 'editor' );
}
}
}
add_action('init', 'remove_editor');