Opened 12 years ago
Last modified 7 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Options, Meta APIs | Version: | 3.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.