WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 22 months ago

#18263 closed enhancement (wontfix)

Doing it Wrong for Taxonomies

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

Description

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 3 years ago.
tax-doin-wrong-2.patch (753 bytes) - added by WraithKenny 3 years ago.
tax-doin-wrong-3.patch (661 bytes) - added by WraithKenny 3 years ago.

Download all attachments as: .zip

Change History (10)

WraithKenny3 years ago

comment:1 nacin3 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.

comment:2 Viper007Bond3 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(
	'item1',
	'item2',
);
  • 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.

comment:3 WraithKenny3 years ago

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

comment:4 WraithKenny3 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.)

comment:5 WraithKenny2 years ago

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

lack of interest.

comment:6 SergeyBiryukov2 years ago

  • Milestone Awaiting Review deleted

comment:7 WraithKenny22 months ago

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

Note: See TracTickets for help on using tickets.