Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 9 years ago

#18263 closed enhancement (wontfix)

Doing it Wrong for Taxonomies

Reported by: wraithkenny's profile WraithKenny Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Warnings/Notices Keywords: has-patch
Focuses: Cc:


Doing it Wrong messages should be giving for registering taxonomies with reserved terms.

Attachments (3)

tax-doin-wrong.patch (1.1 KB) - added by WraithKenny 13 years ago.
tax-doin-wrong-2.patch (753 bytes) - added by WraithKenny 13 years ago.
tax-doin-wrong-3.patch (661 bytes) - added by WraithKenny 13 years ago.

Download all attachments as: .zip

Change History (11)

#1 @nacin
13 years ago

I don't think the existing taxonomies need to be "reserved". Also, as mentioned in IRC, this is a duplicate of another ticket.

The issue I've generally seen is that "type" breaks the media uploader. I'd rather fix that.

#2 @Viper007Bond
13 years ago

Some patch feedback I wrote before I saw nacin's reply but that I'm posting anyway:

  • Tabs shouldn't be used inline. Look how weird that array looks in Trac. Your tab sizes are different than what Trac and my text editor uses. ;) Simple solution is to just add a line break before the first item which the standard way in WordPress:
$foo = array(
  • It doesn't seem like a good idea for maintainability reasons to keep a separate list of built-in taxonomies. It'd be better to dynamically build this list.
  • The code for generating the list for the Codex shouldn't go into core. It's trivial to create by hand and the code could instead be stored somewhere on the Codex.

#3 @WraithKenny
13 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

#4 @WraithKenny
13 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Related to #12917 which is marked invalid, so I assume from Nacin's comment that fixing the Media Library so type can be registered as a taxonomy is the way to go? type does seem to be the lone term that causes issues. Regardless, the code dealing with that ticket's issue has been removed from these newer patches.

Related to #15824 which is set to fixed so I had assumed opening new tickets for new _doing_it_wrong calls. I'm reopening this one with that in mind.

As for the tabs: I'm hoping that since I've only tabbed 2 deep this time, it shouldn't be a problem :-)

I had included the core-registered taxonomies merely for completeness (and notice for the type issue), which is removed in the newer patches. The check for _builtin prevents trigger_error against core registrations. The list is pulled only from the query vars now.

I had occurred to me after work, that plugins that register the same taxonomy twice would receive the error (via public_query_vars), and it wouldn't make sense.

tax-doin-wrong-3.patch prevents trigger_errors on twice registered taxonomies at the cost of a global. (I left the global in my code block for review, but I can resubmit the patch with it at the top of the function.)

#5 @WraithKenny
13 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

lack of interest.

#6 @SergeyBiryukov
13 years ago

  • Milestone Awaiting Review deleted

#7 @WraithKenny
12 years ago

#12929 must have been the ticket nacin was referring to above.

Note: See TracTickets for help on using tickets.