仅为页面禁用古腾堡
Disable Gutenberg only for page
我只想为页面禁用古腾堡,而不是 post
add_filter('use_block_editor_for_post', '__return_false', 10);
add_filter('use_block_editor_for_post_type', '__return_false', 10);
请检查下面的代码片段。
add_filter( 'use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2 );
function prefix_disable_gutenberg( $current_status, $post_type ) {
if ( 'page' === $post_type ) return false;
return $current_status;
}
我只想为页面禁用古腾堡,而不是 post
add_filter('use_block_editor_for_post', '__return_false', 10);
add_filter('use_block_editor_for_post_type', '__return_false', 10);
请检查下面的代码片段。
add_filter( 'use_block_editor_for_post_type', 'prefix_disable_gutenberg', 10, 2 );
function prefix_disable_gutenberg( $current_status, $post_type ) {
if ( 'page' === $post_type ) return false;
return $current_status;
}