WordPress這個開源的軟件經過用戶的不過發覺出現了各種各樣的功能,有的修改大家看法不一,說的說有用,有的說沒用,但是我總相信存在即合理,被發覺出來就會有朋友需要他的,我要說的這個功能就是這樣。。如果一個頁面使用特殊的模塊設置,那么當你發表了這個頁面時候使用如下代碼就可以禁止頁面被編輯。
把他放進你的functions.php中。不要忘記把06行的模塊名字改成你所使用的
add_action( 'admin_init', 'hide_editor' );
function hide_editor() {
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ;
if( !isset( $post_id ) ) return;
$template_file = get_post_meta($post_id, '_wp_page_template', true);
if($template_file == 'submit.php'){ // edit the template name
remove_post_type_support('page', 'editor');
}
}