From f7268adfbf6500335fe829a99b416efe968804bb Mon Sep 17 00:00:00 2001 From: TimothyBlynJacobs Date: Fri, 17 Jul 2020 02:59:08 +0000 Subject: [PATCH] Meta: Reorder the get_metadata_default() signature to match get_metadata(). The order of parameters in `get_metadata_default()` did not match the signature of `get_metadata()`. This could be confusing for developers who are familiar with the existing metadata API. Fixes #43941. Props SergeyBiryukov, spacedmonkey, johnjamesjacoby. Built from https://develop.svn.wordpress.org/trunk@48502 git-svn-id: http://core.svn.wordpress.org/trunk@48264 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/meta.php | 9 +++++---- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-includes/meta.php b/wp-includes/meta.php index 805725074b..88edf152cd 100644 --- a/wp-includes/meta.php +++ b/wp-includes/meta.php @@ -508,7 +508,7 @@ function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) return $value; } - return get_metadata_default( $meta_type, $meta_key, $single, $object_id ); + return get_metadata_default( $meta_type, $object_id, $meta_key, $single ); } /** @@ -595,13 +595,14 @@ function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = fal * * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', * or any other object type with an associated meta table. - * @param string $meta_key Metadata key. + * @param int $object_id ID of the object metadata is for. + * @param string $meta_key Metadata key. If not specified, retrieve all metadata for + * the specified object. Default empty. * @param bool $single Optional. If true, return only the first value of the specified meta_key. * This parameter has no effect if meta_key is not specified. Default false. - * @param int $object_id Optional. ID of the object metadata is for. Default 0. * @return mixed Single metadata value, or array of values. */ -function get_metadata_default( $meta_type, $meta_key, $single = false, $object_id = 0 ) { +function get_metadata_default( $meta_type, $object_id, $meta_key, $single = false ) { if ( $single ) { $value = ''; } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index dec0eb67f8..2d9df6479e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-beta2-48501'; +$wp_version = '5.5-beta2-48502'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.