WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#31155 closed enhancement (duplicate)

register_taxonomy function does not check reserved taxonomies

Reported by: sebastiaandegeus Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2
Component: Taxonomy Keywords:
Focuses: Cc:

Description

the function register_taxonomy() in wp-includes/taxonomy.php does not check for reserved taxonomies. But later on this will cause malfunctions or unexpected behaviour and bugs.

I wrote a very simple patch that checks if any of the reserved taxonomies are being registered and if so it notifies the developer by _doing_it_wrong and WP_Error as a fallback.

Projects and plugins that are using reserved taxonomies in the wild will not break. But the developers will be notified via the logs or on their development environments where WP_DEBUG is true.

Attachments (1)

check_reserved_taxonomies.diff (3.0 KB) - added by sebastiaandegeus 7 years ago.

Download all attachments as: .zip

Change History (4)

#1 @danielbachhuber
7 years ago

Projects and plugins that are using reserved taxonomies in the wild will not break.

But you're returning early and the taxonomy wouldn't be registered?

Co-Authors Plus uses an author taxonomy behind the scenes, which seems like a perfectly valid use that would be broken by this patch.

#3 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #12929 and #18263.

Note: See TracTickets for help on using tickets.