WordPress
6
Вклад в тег
function disable_content_editor()
{
if (isset($_GET['post'])) {
$post_ID = $_GET['post'];
} else if (isset($_POST['post_ID'])) {
$post_ID = $_POST['post_ID'];
}
if (!isset($post_ID) || empty($post_ID)) {
return;
}
$page_template = get_post_meta($post_ID, '_wp_page_template', true);
if ($page_template == 'front-page.php') {
remove_post_type_support('page', 'editor');
}
}
add_action('admin_init', 'disable_content_editor');