Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#31155 closed enhancement (duplicate)

register_taxonomy function does not check reserved taxonomies

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

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 11 years ago.

Download all attachments as: .zip

Change History (4)

#1 @danielbachhuber
11 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
11 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Duplicate of #12929 and #18263.

Note: See TracTickets for help on using tickets.