Make WordPress Core

Opened 7 weeks ago

Last modified 8 days ago

#53102 new defect (bug)

Incorrect documentation for delete_{$meta_type}_meta and deleted_{$meta_type}_meta filter hooks

Reported by: pputzer Owned by:
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.4
Component: Options, Meta APIs Keywords: needs-patch good-first-bug
Focuses: docs Cc:


The inline documentation for delete_{$meta_type}_meta and deleted_{$meta_type}_meta incorrectly states that the $_meta_value parameter is Serialized if non-scalar (from [47390]). While $meta_value is run through maybe_serialize, $_meta_value is not.

Also, I think the hook documentation should make it clear that the meta value is only passed from the optional function argument, so it might not contain anything meaningful.

Change History (3)

#1 @pputzer
7 weeks ago

On further investigation, the issue may stem at least partially from the to separate uses of the hook in delete_metadata and delete_metadata_by_mid. The latter uses get_metadata_by_mid to retrieve the current values before deleting the metadata. The meta value is still not serialized, though.

I think the best solution would be to read the actual meta values in delete_metadata as well.

#2 @SergeyBiryukov
7 weeks ago

  • Component changed from General to Options, Meta APIs
  • Milestone changed from Awaiting Review to 5.8

#3 @desrosj
8 days ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from 5.8 to 5.9

The beta 1 deadline is today. Since this one does not yet have a patch, I am going to punt to 5.9. However, documentation changes are allowed during the beta part of the release cycle. If someone is able to create a patch before 29 June, it can be moved back.

Note: See TracTickets for help on using tickets.