Make WordPress Core

Opened 5 months ago

Last modified 2 weeks 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: good-first-bug has-patch
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.

Attachments (1)

53102.diff (3.1 KB) - added by hasanuzzamanshamim 2 weeks ago.
Removed "Serialized if non-scalar"

Download all attachments as: .zip

Change History (5)

#1 @pputzer
5 months 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
5 months ago

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

#3 @desrosj
4 months 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.

2 weeks ago

Removed "Serialized if non-scalar"

#4 @hasanuzzamanshamim
2 weeks ago

  • Keywords has-patch added; needs-patch removed
Note: See TracTickets for help on using tickets.