Opened 16 years ago
Closed 16 years ago
#11125 closed defect (bug) (fixed)
added_{$meta_type}_meta, and update_{$meta_type}_meta actions have inconsistent arguments
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 2.9 | Priority: | normal |
| Severity: | major | Version: | |
| Component: | General | Keywords: | has-patch dev-feedback |
| Focuses: | Cc: |
Description
added_{$meta_type}_meta: $wpdb->insert_id, $object_id, $meta_key, $meta_value
update_{$meta_type}_meta: $object_id, $meta_key, $meta_value, $meta_id
In the former, $meta_id is first. In the later, $meta_id is last.
They should have the same argument order.
Attachments (2)
Change History (6)
#2
@
16 years ago
- Keywords has-patch dev-feedback added
- Owner set to mdawaffe
- Status changed from new to accepted
#3
in reply to:
↑ 1
@
16 years ago
- Severity changed from normal to major
Replying to mdawaffe:
I suggest all the metadata hooks use that order (object_id, key, value, meta_id).
That suggestion is a bad one.
The actions need to have arguments in the following order instead.
meta_id(s), object_id, key, value
I didn't realize that in addition to the (added|updated|update|deleted)_{$meta_type}_meta actions, there were already pre-existing (added|updated|update|deleted)_(post|user)_meta actions. These pre-existing actions all use the above argument order.
New patch puts them in the correct order.
Bumping severity since it's now a real bug, not just a new inconsistency.
delete_metadata calls the following hook:
deleted_{$meta_type}_meta: $object_id, $meta_key, $meta_value, $meta_ids
I suggest all the metadata hooks use that order (object_id, key, value, meta_id).