php 禁用古腾堡

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 禁用古腾堡相关的知识,希望对你有一定的参考价值。

// Disable Gutenberg Completely

// disable for posts
add_filter('use_block_editor_for_post', '__return_false', 10);

// disable for post types
add_filter('use_block_editor_for_post_type', '__return_false', 10);



//Disable Gutenberg for Custom Post Types

function disable_gutenberg_page($is_enabled, $post_type) {	
	if ($post_type === 'page') return false;	
	return $is_enabled;	
}
add_filter('use_block_editor_for_post_type', 'disable_gutenberg_page', 10, 2);

function disable_gutenberg_block($is_enabled, $post_type) {	
	if ($post_type === 'blocks') return false;	
	return $is_enabled;	
}
add_filter('use_block_editor_for_post_type', 'disable_gutenberg_block', 10, 2);

以上是关于php 禁用古腾堡的主要内容,如果未能解决你的问题,请参考以下文章