[wp-trac] [WordPress Trac] #48401: Saving a Post Breaks in Gutenberg if you have a custom taxonomy named Status
WordPress Trac
noreply at wordpress.org
Tue Oct 22 16:28:18 UTC 2019
#48401: Saving a Post Breaks in Gutenberg if you have a custom taxonomy named
Status
--------------------------+-----------------------------
Reporter: kingkool68 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Steps to reproduce:
Register a taxonomy called Status:
{{{
function custom_taxonomy() {
$labels = array(
'name' => 'Status',
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'show_in_rest' => true,
);
register_taxonomy( 'status', array( 'post' ), $args );
}
add_action( 'init', 'custom_taxonomy', 0 );
}}}
Create a new Post using the Gutenberg editor
Try and Publish the post
Publishing should fail.
Add `rest_base => 'status_tax'` and publishing a post should work as
expected.
The issue is if the `rest_base` argument isn't specified
`register_taxonomy()` will use the taxonomy key as the rest base. In this
case that would be `status` which is already a REST API route.
There should be a check to make sure a reserved REST API base isn't used.
Ideally it would modify the default used to avoid the conflict such as
appending `_tax`. Or atleast an error or warning should be thrown
somewhere.
There is some confusion out there that this is a conflict between
different plugins as documented here -->
https://wordpress.org/support/topic/conflict-between-cpt-ui-and-acf-pro-
in-the-block-editor/
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48401>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list