我正在尝试(尽管其他人之前发表了很多帖子,但都失败了)更容易/更可靠地从该页面中删除内容编辑器。
我可以使用页面ID将其删除:
add_action( \'admin_head\', \'hide_editor\' );
function hide_editor() {
if( isset( $_GET[\'post\'] ) && $_GET[\'post\'] == \'7\' ) // \'7\' is the ID of the page ID.
remove_post_type_support( \'page\', \'editor\' );
}
但我更愿意根据使用的模板删除它-在本例中,默认的“home”。php’。我尝试了各种条件,包括“get\\u page\\u template”和“is\\u page\\u template”的变体,但都不起作用。。。我怀疑是因为页面使用的是默认模板,而不是选定的模板。