#17617 closed defect (bug) (fixed)
"edit_tag_form" action incorrectly performed for categories
Reported by: | michaeltyson | Owned by: | dd32 |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Administration | Keywords: | needs-patch |
Focuses: | Cc: |
Description
There is a typo in wp-admin/edit-tag-form.php (in WP 3.1.3 and trunk, at least) that results in the "edit_tag_form" action being performed for categories, incorrectly.
The attached patch should correct the issue.
Attachments (1)
Change History (9)
#2
@
13 years ago
Positive; see the patch (or http://core.trac.wordpress.org/browser/trunk/wp-admin/edit-tag-form.php#L83)
#3
@
13 years ago
- Keywords reporter-feedback removed
- Milestone changed from Awaiting Review to 3.2
Regression somehow caused by [15820].
#5
@
13 years ago
- Keywords needs-patch added; has-patch removed
Looking at that changeset, and the patch here, the changeset includes a few more if's that should be an elseif.
#6
@
13 years ago
Looks like a few other things from that commit had already been fixed (ie. [15823])
Plugins using hooks such as edit_tag_form
need to be aware that this hook is also run for any custom taxonomies, The only pages it shouldn't be run on are categories and link categories.
Plugins should instead use the taxonomy-specific actions such as post_tag_pre_add_form
, post_tag_add_form
, post_tag_pre_edit_form
, post_tag_edit_form_fields
and post_tag_edit_form
.
#7
@
13 years ago
- Owner set to dd32
- Resolution set to fixed
- Status changed from new to closed
In [18078]:
#8
@
13 years ago
Tidbit of code for testing these actions too (dump the filternames when run)
add_action('init', 'taxonomy_form_fields', 10000); function taxonomy_form_fields() { $actions = array('edit_category_form_pre', 'edit_link_category_form_pre', 'edit_tag_form_pre', '_pre_edit_form', 'edit_category_form_fields', 'edit_link_category_form_fields', 'edit_tag_form_fields', '_edit_form_fields', 'edit_category_form', 'edit_link_category_form', 'edit_tag_form', '_edit_form', 'add_category_form_pre', 'add_link_category_form_pre', 'add_tag_form_pre', '_pre_add_form', 'edit_category_form', 'edit_link_category_form', 'add_tag_form', '_add_form'); foreach ( array_unique($actions) as $action ) { if ( '_' != $action{0} ) add_action($action, 'echo_current_filter'); else foreach ( get_taxonomies() as $tax ) add_action( $tax . $action, 'echo_current_filter'); } function echo_current_filter() { var_dump(current_filter()); } }
Sure?
http://core.trac.wordpress.org/browser/trunk/wp-admin/edit-tag-form.php#L19 there is an elseif.