Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#29853 closed defect (bug) (fixed)

Introduce parity to 'taxonomy_parent_dropdown_args' filter.

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by: boonebgorges's profile boonebgorges
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.7
Component: Taxonomy Keywords: has-patch
Focuses: administration Cc:

Description

In version 3.7 the taxonomy_parent_dropdown_args filter was introduced in wp-admin/edit-tags.php. For whatever reason, this filter is only on the new/list tag page, not the edit single tag page.

This patch applies the same drop down args filter that exists on the new/list page on the edit single tag page.

Attachments (3)

edit-tag-form.diff (1.5 KB) - added by TimothyBlynJacobs 10 years ago.
edit-tag-form2.diff (2.8 KB) - added by TimothyBlynJacobs 10 years ago.
Filters the taxonomy dropdown args with a separate filter.
29853.diff (2.5 KB) - added by TimothyBlynJacobs 10 years ago.

Download all attachments as: .zip

Change History (15)

@TimothyBlynJacobs
10 years ago

Filters the taxonomy dropdown args with a separate filter.

#1 @DrewAPicture
10 years ago

  • Keywords has-patch added
  • Version changed from trunk to 3.7

I think attachment is the way to go. We don't need a new filter, especially as they effect the same output for both screens. I could however see adding a third parameter, $context that specifies the context the filter is running in.

#2 follow-up: @TimothyBlynJacobs
10 years ago

I'll add another patch. What would we use for the two values of $context? Perhaps new and edit?

#3 in reply to: ↑ 2 @DrewAPicture
10 years ago

Replying to TimothyBlynJacobs:

I'll add another patch. What would we use for the two values of $context? Perhaps new and edit?

Good question. Maybe new-term and edit-term you think? When you add the third parameter, just also add a second @since tag to the original hook doc. Something like this:

* @since 4.1.0 Added $context parameter.

#4 @TimothyBlynJacobs
10 years ago

Sounds good to me! Will do.

#5 @TimothyBlynJacobs
10 years ago

Patch with context parameter and same filter.

#6 @TimothyBlynJacobs
10 years ago

Can this be looked at for 4.1?

#7 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Status changed from new to reviewing

#8 @TimothyBlynJacobs
10 years ago

boonebgorges do you think this can go into 4.2?

#9 @boonebgorges
10 years ago

  • Milestone changed from Awaiting Review to 4.2

It should be noted that there's an outside chance that applying the same filter to the tag edit interface will cause problems with plugins that expect it only to apply when creating a tag. That being said, I searched Github and the plugins repo for examples, but couldn't find any - the filter appears to be rarely used. And it's likely that in most cases, applying the filter is going to fix bugs rather than cause them. So let's go with it, and add the $context param as DrewAPicture suggests.

I think 'new' and 'edit' are more straightforward values for $context. "taxonomy" is in the filter name, so 'term' is redundant.

#10 @boonebgorges
10 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 30998:

Apply 'taxonomy_parent_dropdown_args' filter when editing terms.

Added in WP 3.7 [25123], the 'taxonomy_parent_dropdown_args' filter affected
only the term creation interface. This changeset introduces parity by ensuring
that it is applied when editing terms as well.

The new $context parameter indicates whether the filter is being applied in
a 'new' or 'edit' context.

Props TimothyBlynJacobs, DrewAPicture.
Fixes #29853.

#11 @dimadin
10 years ago

Shouldn't @since be 4.2? Same applies for [30993].

#12 @boonebgorges
10 years ago

dimadin - Oops, thanks - I forgot to change that part of the patch. [30993] should have its @since tag updated too, though it'll have to be either 4.1.1 or 4.2.0.

Note: See TracTickets for help on using tickets.