_disable_block_editor_for_navigation_post_type

函数
_disable_block_editor_for_navigation_post_type ( $value, $post_type )
Access
Private
参数
  • (bool) $value Whether the CPT supports block editor or not.
    Required:
  • (string) $post_type Post type.
    Required:
返回值
  • (bool) Whether the block editor should be disabled or not.
定义位置
相关方法
_disable_content_editor_for_navigation_post_type_enable_content_editor_for_navigation_post_typeuse_block_editor_for_post_typeuse_block_editor_for_postblock_core_navigation_get_post_ids
引入
5.9.0
弃用
-

_disable_block_editor_for_navigation_post_type: 这个函数用于禁用导航文章类型的区块编辑器: 这是为了保持对尚未过渡到使用区块编辑器的旧WordPress主题的向后兼容性。

禁用wp_navigation类型文章的区块编辑器,以便可以通过用户界面管理它们。

function _disable_block_editor_for_navigation_post_type( $value, $post_type ) {
	if ( 'wp_navigation' === $post_type ) {
		return false;
	}

	return $value;
}

常见问题

FAQs
查看更多 >