WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/17/2020 02:57:04 AM (15 months ago)
Author:
TimothyBlynJacobs
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/meta.php

    r48473 r48502  
    509509    }
    510510
    511     return get_metadata_default( $meta_type, $meta_key, $single, $object_id );
     511    return get_metadata_default( $meta_type, $object_id, $meta_key, $single );
    512512}
    513513
     
    596596 * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
    597597 *                          or any other object type with an associated meta table.
    598  * @param string $meta_key  Metadata key.
     598 * @param int    $object_id ID of the object metadata is for.
     599 * @param string $meta_key  Metadata key. If not specified, retrieve all metadata for
     600 *                          the specified object. Default empty.
    599601 * @param bool   $single    Optional. If true, return only the first value of the specified meta_key.
    600602 *                          This parameter has no effect if meta_key is not specified. Default false.
    601  * @param int    $object_id Optional. ID of the object metadata is for. Default 0.
    602603 * @return mixed Single metadata value, or array of values.
    603604 */
    604 function get_metadata_default( $meta_type, $meta_key, $single = false, $object_id = 0 ) {
     605function get_metadata_default( $meta_type, $object_id, $meta_key, $single = false ) {
    605606    if ( $single ) {
    606607        $value = '';
Note: See TracChangeset for help on using the changeset viewer.