#18823 closed enhancement (wontfix)
Pass $post_id as second argument to delete_postmeta action
Reported by: | Vynce | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 3.2 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
in every case (in WP 3.2) where a postmeta is deleted, the context is aware of the post_id or post_ids affected. The do_action calls for added_postmeta, update_postmeta, and updated_postmeta all pass the post_id as the second argument. For parallelism, and because it is useful, please pass it for delete_postmeta (and deleted_postmeta).
Change History (3)
Note: See
TracTickets for help on using
tickets.
I think that the extra values weren't passed for delete_postmeta as this action is used in two different circumstances. delete_meta and delete_post_meta_by_key act on different information. The former takes a specific meta id which is tied to one object, the latter can delete meta from multiple objects. See #10750 and [11968] for the original introduction of the action. We might want to think about this before changing something. However, they are already inconsistent in what type of data gets passed...
The delete(d)_postmeta actions are also passed arrays and integers inconsistently (delete_meta vs. delete_post_meta_by_key again). Though this isn't new it could be fixed, but I'm unsure how this may affect back compat.
See #18825 for a ticket I opened about backwards incompatibility in these actions in 3.3.