Changeset 48502
- Timestamp:
- 07/17/2020 02:57:04 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r48473 r48502 509 509 } 510 510 511 return get_metadata_default( $meta_type, $ meta_key, $single, $object_id);511 return get_metadata_default( $meta_type, $object_id, $meta_key, $single ); 512 512 } 513 513 … … 596 596 * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', 597 597 * 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. 599 601 * @param bool $single Optional. If true, return only the first value of the specified meta_key. 600 602 * 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.602 603 * @return mixed Single metadata value, or array of values. 603 604 */ 604 function get_metadata_default( $meta_type, $ meta_key, $single = false, $object_id = 0) {605 function get_metadata_default( $meta_type, $object_id, $meta_key, $single = false ) { 605 606 if ( $single ) { 606 607 $value = ''; -
trunk/tests/phpunit/tests/meta/registerMeta.php
r48411 r48502 521 521 $object_property_name = $object_type . '_id'; 522 522 $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 ); 524 524 $this->assertSame( $default_value, $expected ); 525 525 … … 568 568 $object_property_name = $object_type . '_id'; 569 569 $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 ); 571 571 $this->assertSame( $default_value, $expected ); 572 572 }
Note: See TracChangeset
for help on using the changeset viewer.