我知道如何在单个特定页面上阻止内容编辑器,但我希望在多个页面上阻止它。
在下面的代码中,如果在下面添加另一个页面文件,则所有内容都会中断。
是否有一种方法可以引用多个模板文件?
谢谢
function wpcs_disable_content_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 == \'page-custom-one.php\', \'page-custom-two.php\' ) {
remove_post_type_support( \'page\', \'editor\' );
}
}add\\u操作(\'admin\\u init\',\'wpcs\\u disable\\u content\\u editor\');