_enable_content_editor_for_navigation_post_type

函数
_enable_content_editor_for_navigation_post_type ( $post )
Access
Private
参数
  • (WP_Post) $post An instance of WP_Post class.
    Required:
相关
  • _disable_content_editor_for_navigation_post_type
定义位置
相关方法
_disable_content_editor_for_navigation_post_type_disable_block_editor_for_navigation_post_typeuse_block_editor_for_post_typeblock_core_navigation_get_post_ids_close_comments_for_old_post
引入
5.9.0
弃用
-

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

这个回调可以启用wp_navigation类型文章的内容编辑器。

我们需要重新启用它,因为我们禁用它来隐藏wp_navigation类型文章的内容编辑器。

function _enable_content_editor_for_navigation_post_type( $post ) {
	$post_type = get_post_type( $post );
	if ( 'wp_navigation' !== $post_type ) {
		return;
	}

	add_post_type_support( $post_type, 'editor' );
}

常见问题

FAQs
查看更多 >