Changeset 48192
- Timestamp:
- 06/27/2020 04:32:57 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/meta.php
r48121 r48192 55 55 56 56 /** 57 * Filters whether to addmetadata of a specific type.57 * Short-circuits adding metadata of a specific type. 58 58 * 59 59 * The dynamic portion of the hook, `$meta_type`, refers to the meta … … 184 184 185 185 /** 186 * Filters whether to updatemetadata of a specific type.186 * Short-circuits updating metadata of a specific type. 187 187 * 188 188 * The dynamic portion of the hook, `$meta_type`, refers to the meta … … 354 354 355 355 /** 356 * Filters whether to deletemetadata of a specific type.356 * Short-circuits deleting metadata of a specific type. 357 357 * 358 358 * The dynamic portion of the hook, `$meta_type`, refers to the meta … … 475 475 476 476 /** 477 * Retrieves metadata for the specified object. 477 * Retrieves the value of a metadata field for the specified object type and ID. 478 * 479 * If the meta field exists, a single value is returned if `$single` is true, or an array of values if it's false. 480 * If the meta field does not exist, an empty string is returned if `$single` is true, or an empty array if it's false. 481 * If there's a problem with the parameters passed to the function, boolean `false` is returned. 478 482 * 479 483 * @since 2.9.0 … … 486 490 * @param bool $single Optional. If true, return only the first value of the specified meta_key. 487 491 * This parameter has no effect if meta_key is not specified. Default false. 488 * @return mixed Single metadata value, or array of values492 * @return mixed The metadata value or array of values. See description above for further details. 489 493 */ 490 494 function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) { … … 499 503 500 504 /** 501 * Filters whether to retrieve metadata of a specific type.502 * 503 * The dynamic portion of the hook , `$meta_type`, refers to the meta505 * Short-circuits the return value of a meta field. 506 * 507 * The dynamic portion of the hook name, `$meta_type`, refers to the 504 508 * object type (comment, post, term, or user). Returning a non-null value 505 * will effectively short-circuit the function.509 * will short-circuit the return value. 506 510 * 507 511 * @since 3.1.0 508 512 * 509 * @param null|array|string $value The value get_metadata() should return - a single metadata value,510 * or an array of values.511 * @param int 512 * @param string 513 * @param bool 513 * @param mixed $value The value to return, either a single metadata value or an array 514 * of values depending on the value of `$single`. Default null. 515 * @param int $object_id ID of the object metadata is for. 516 * @param string $meta_key Metadata key. 517 * @param bool $single Whether to return only the first value of the specified $meta_key. 514 518 */ 515 519 $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single ); … … 553 557 554 558 /** 555 * Determines if a meta key is set for a given object.559 * Determines if a meta field with the given key exists for the given object ID. 556 560 * 557 561 * @since 3.3.0 … … 561 565 * @param int $object_id ID of the object metadata is for. 562 566 * @param string $meta_key Metadata key. 563 * @return bool True of the key is set, false if not.567 * @return bool Whether a meta field with the given key exists. 564 568 */ 565 569 function metadata_exists( $meta_type, $object_id, $meta_key ) { … … 603 607 * or any other object type with an associated meta table. 604 608 * @param int $meta_id ID for a specific meta row. 605 * @return object|false Meta object or false. 609 * @return stdClass|false { 610 * Metadata object, or boolean `false` if the metadata doesn't exist. 611 * 612 * @type string $meta_key The meta key. 613 * @type mixed $meta_value The unserialized meta value. 614 * @type string $meta_id Optional. The meta ID when the meta type is any value except 'user'. 615 * @type string $umeta_id Optional. The meta ID when the meta type is 'user'. 616 * @type string $post_id Optional. The object ID when the meta type is 'post'. 617 * @type string $comment_id Optional. The object ID when the meta type is 'comment'. 618 * @type string $term_id Optional. The object ID when the meta type is 'term'. 619 * @type string $user_id Optional. The object ID when the meta type is 'user'. 620 * } 606 621 */ 607 622 function get_metadata_by_mid( $meta_type, $meta_id ) { … … 625 640 626 641 /** 627 * Filters whether to retrieve metadata of a specific typeby meta ID.628 * 629 * The dynamic portion of the hook , `$meta_type`, refers to the meta642 * Short-circuits the return value when fetching a meta field by meta ID. 643 * 644 * The dynamic portion of the hook name, `$meta_type`, refers to the 630 645 * object type (comment, post, term, or user). Returning a non-null value 631 * will effectively short-circuit the function.646 * will short-circuit the return value. 632 647 * 633 648 * @since 5.0.0 634 649 * 635 * @param mixed $value The value get_metadata_by_mid() shouldreturn.636 * @param int $meta_idMeta ID.650 * @param stdClass|null $value The value to return. 651 * @param int $meta_id Meta ID. 637 652 */ 638 653 $check = apply_filters( "get_{$meta_type}_metadata_by_mid", null, $meta_id ); … … 690 705 691 706 /** 692 * Filters whether to updatemetadata of a specific type by meta ID.707 * Short-circuits updating metadata of a specific type by meta ID. 693 708 * 694 709 * The dynamic portion of the hook, `$meta_type`, refers to the meta … … 806 821 807 822 /** 808 * Filters whether to deletemetadata of a specific type by meta ID.823 * Short-circuits deleting metadata of a specific type by meta ID. 809 824 * 810 825 * The dynamic portion of the hook, `$meta_type`, refers to the meta … … 911 926 912 927 /** 913 * Filters whether to updatethe metadata cache of a specific type.928 * Short-circuits updating the metadata cache of a specific type. 914 929 * 915 930 * The dynamic portion of the hook, `$meta_type`, refers to the meta
Note: See TracChangeset
for help on using the changeset viewer.