我需要在某些页面的编辑屏幕上禁用古腾堡编辑器。
我知道如何针对帖子类型禁用它,例如所有页面:
/************************************************************ */
/* Disable Gutenberg for post type */
add_filter('use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2);
function prefix_disable_gutenberg($current_status, $post_type)
{
if ( $post_type == 'page' ) return false;
return $current_status;
}
Run Code Online (Sandbox Code Playgroud)
但我只想对某个页面禁用它,假设 ID 为“1716”。
如何以编程方式禁用某些页面 ID 的古腾堡编辑器?