diff --git a/src/wp-includes/meta.php b/src/wp-includes/meta.php
index 7959be5576..8599d24d8c 100644
|
a
|
b
|
function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) |
| 502 | 502 | * @param bool $single Whether to return only the first value of the specified $meta_key. |
| 503 | 503 | */ |
| 504 | 504 | $check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single ); |
| | 505 | |
| 505 | 506 | if ( null !== $check ) { |
| 506 | 507 | if ( $single && is_array( $check ) ) { |
| 507 | 508 | return $check[0]; |
| … |
… |
function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) |
| 516 | 517 | $meta_cache = update_meta_cache( $meta_type, array( $object_id ) ); |
| 517 | 518 | $meta_cache = $meta_cache[ $object_id ]; |
| 518 | 519 | } |
| | 520 | |
| | 521 | /** |
| | 522 | * Filters whether to retrieve meta cache of a specific type. |
| | 523 | * |
| | 524 | * The dynamic portion of the hook, `$meta_type`, refers to the meta |
| | 525 | * object type (comment, post, or user). |
| | 526 | * |
| | 527 | * @param array $value The value get_metadata() should return - a single metadata value, or an array of values. |
| | 528 | * @param array $meta_cache Array to be Filtered. |
| | 529 | * @param int $object_id Object ID. |
| | 530 | * @param string $meta_key Meta key. |
| | 531 | * @param bool $single Whether to return only the first value of the specified $meta_key. |
| | 532 | */ |
| | 533 | |
| | 534 | $meta_cache = apply_filters( "get_{$meta_type}_meta_cache", $meta_cache, $object_id, $meta_key, $single ); |
| 519 | 535 | |
| 520 | 536 | if ( ! $meta_key ) { |
| 521 | 537 | return $meta_cache; |