fix - show_in_rest attr to taxonomies used by post types
This commit is contained in:
parent
423195debf
commit
b3f24fc4ca
|
@ -68,10 +68,15 @@ class Taxonomy extends Entity {
|
||||||
'menu_name' => $this->get_name(),
|
'menu_name' => $this->get_name(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$enabled_post_types = $this->get_enabled_post_types();
|
||||||
|
$enabled_post_types = sizeof($enabled_post_types) ? $enabled_post_types : null;
|
||||||
|
$show_ui = is_array($enabled_post_types) ? true : false;
|
||||||
|
|
||||||
$args = array(
|
$args = array(
|
||||||
'hierarchical' => true,
|
'hierarchical' => true,
|
||||||
'labels' => $labels,
|
'labels' => $labels,
|
||||||
'show_ui' => true,
|
'show_ui' => $show_ui,
|
||||||
|
'show_in_rest' => $show_ui,
|
||||||
'show_admin_column' => false,
|
'show_admin_column' => false,
|
||||||
'rewrite' => [
|
'rewrite' => [
|
||||||
'slug' => $this->get_slug()
|
'slug' => $this->get_slug()
|
||||||
|
@ -82,8 +87,7 @@ class Taxonomy extends Entity {
|
||||||
unregister_taxonomy($this->get_db_identifier());
|
unregister_taxonomy($this->get_db_identifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
$enabled_post_types = $this->get_enabled_post_types();
|
|
||||||
$enabled_post_types = sizeof($enabled_post_types) ? $enabled_post_types : null;
|
|
||||||
|
|
||||||
register_taxonomy(
|
register_taxonomy(
|
||||||
$this->get_db_identifier(),
|
$this->get_db_identifier(),
|
||||||
|
|
Loading…
Reference in New Issue