Opened 10 years ago
Last modified 6 years ago
#29082 reviewing enhancement
Pass $meta_id into sanitize_meta() and subsequently into the filter for register_meta callback
Reported by: | sc0ttkclark | Owned by: | chriscct7 |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.3 |
Component: | Options, Meta APIs | Keywords: | has-patch |
Focuses: | Cc: |
Description
To use Post Type based sanitization for specific meta keys, currently register_meta adds the filter but while the 'auth' filter gets access to the Post ID, the 'sanitize' filter does not. We would need to add $object_id in the cases of add/update_metadata, and in the case of update_metadata_by_mid we'd need to pass the Post ID into that function as well, which would then pass along to sanitize_meta() usage.
Is anyone against this proposal? If so, a patch can be drawn up.
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Makes sense to me and I see no issues with backward compatibility.
Only issue would be direct calls to
sanitize_meta()
, but plugins should hook into the filter, so I don't actually expect an issue with that.Added a patch implementing @sc0ttkclark's suggestion.