假设为自定义文章类型service创建了一个taxonomy为services。那么创建的过程中,要添加show_in_rest属性,其值为true。这样,新的gutenburg编辑器才能将创建好的分类挂载到编辑器右边栏中。

register_taxonomy(
		'services',
		'service',
		array(
			'label' => '服务类别',
			'rewrite' => array( 'slug' => 'services' ),
			'hierarchical' => true,
			'show_in_rest' => true,
		)
);
类似的问题

wordpress5.0.X的版本下,创建自定义文章类型,新建文章页时,默认编辑器是经典编辑器,如果想用新的gutenburg编辑器,那么在register_post_type中添加’show_in_rest’ => true,即可。