Make WordPress Core

Opened 7 weeks ago

Last modified 8 days ago

#48401 new defect (bug)

Saving a Post Breaks in Gutenberg if you have a custom taxonomy named Status

Reported by: kingkool68 Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: REST API Keywords: needs-patch good-first-bug needs-unit-tests
Focuses: Cc:
PR Number:


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/

Change History (3)

#1 @SergeyBiryukov
7 weeks ago

Thanks for the ticket!

Apparently status should be added to the list of reserved terms (I thought it's already there).

A _doing_it_wrong() notice could also be added to avoid the conflict.

#2 @desrosj
6 weeks ago

  • Keywords needs-patch added

#3 @TimothyBlynJacobs
8 days ago

  • Keywords good-first-bug needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

I agree a _doing_it_wrong would be a good addition. Perhaps in get_item_schem issue a warning if a property is already set with the same name on the schema?

Note: See TracTickets for help on using tickets.