Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#51866 closed defect (bug) (fixed)

metadata_exists does not pass the meta_type to the get_{$meta_type}_metadata filter

Reported by: jsmoriss Owned by: SergeyBiryukov
Priority: normal Milestone: 5.7
Component: Options, Meta APIs Version: 5.5
Severity: normal Keywords: good-first-bug has-patch
Cc: Focuses:

Description

There's a 5th argument missing in this second "get_{$meta_type}_metadata" filter call:

$ grep -n '"get_{$meta_type}_metadata"' wordpress/wp-includes/meta.php
564:	$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single, $meta_type );
676:	$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, true );

Attachments (1)

51866.diff​ (951 bytes ) - added by pbiron 6 years ago.

Download all attachments as: .zip

Change History (6)

#1 @TimothyBlynJacobs
6 years ago

  • Component General → Options, Meta APIs
  • Version 5.5.3 → 5.5

The new parameter was introduced in [48505].

#2 @TimothyBlynJacobs
6 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone Awaiting Review → 5.7
  • Summary Incompat "get_{$meta_type}_metadata" filters in wordpress/wp-includes/meta.php. → metadata_exists does not pass the meta_type to the get_{$meta_type}_metadata filter

@pbiron
6 years ago

#3 @pbiron
6 years ago

  • Keywords has-patch added; needs-patch removed

#4 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Status new → reviewing

#5 @SergeyBiryukov
6 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 49699:

Options, Meta APIs: Pass $meta_type to the get_{$meta_type}_metadata filter in metadata_exists().

This matches the main instance of the filter in get_metadata_raw().

Follow-up to [48505].

Props pbiron, jsmoriss, TimothyBlynJacobs.
Fixes #51866.

Note: See TracTickets for help on using tickets.