WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/17/2020 02:57:04 AM (16 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/tests/phpunit/tests/meta/registerMeta.php

    r48411 r48502  
    521521        $object_property_name = $object_type . '_id';
    522522        $object_id            = self::$$object_property_name;
    523         $default_value        = get_metadata_default( $object_type, $meta_key, $single, $object_id );
     523        $default_value        = get_metadata_default( $object_type, $object_id, $meta_key, $single );
    524524        $this->assertSame( $default_value, $expected );
    525525
     
    568568        $object_property_name = $object_type . '_id';
    569569        $object_id            = self::$$object_property_name;
    570         $default_value        = get_metadata_default( $object_type, $meta_key, $single, $object_id );
     570        $default_value        = get_metadata_default( $object_type, $object_id, $meta_key, $single );
    571571        $this->assertSame( $default_value, $expected );
    572572    }
Note: See TracChangeset for help on using the changeset viewer.