_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
定义位置
  • wp-admin/includes/post.php
    , line 2510
引入
5.9.0
弃用

这个回调可以启用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' );
}