Ticket #51797: 51797.4.diff
File 51797.4.diff, 10.7 KB (added by , 3 years ago) |
---|
-
src/wp-includes/comment.php
493 493 * @param string $key Optional. The meta key to retrieve. By default, 494 494 * returns data for all keys. 495 495 * @param bool $single Optional. Whether to return a single value. 496 * This parameter has no effect if $keyis not specified.496 * This parameter has no effect if `$key` is not specified. 497 497 * Default false. 498 * @return mixed An array if $single is false. The value of meta data field 499 * if $single is true. False for an invalid $comment_id. 498 * @return mixed An array of values if `$single` is false. 499 * The value of meta data field if `$single` is true. 500 * False for an invalid `$comment_id` (non-numeric, zero, or negative value). 501 * An empty string if a valid but non-existing comment ID is passed. 500 502 */ 501 503 function get_comment_meta( $comment_id, $key = '', $single = false ) { 502 504 return get_metadata( 'comment', $comment_id, $key, $single ); -
src/wp-includes/meta.php
497 497 * @param int $object_id ID of the object metadata is for. 498 498 * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for 499 499 * the specified object. Default empty. 500 * @param bool $single Optional. If true, return only the first value of the specified meta_key. 501 * This parameter has no effect if meta_key is not specified. Default false. 502 * @return mixed Single metadata value, or array of values. 503 * False if there's a problem with the parameters passed to the function. 500 * @param bool $single Optional. If true, return only the first value of the specified `$meta_key`. 501 * This parameter has no effect if `$meta_key` is not specified. Default false. 502 * @return mixed An array of values if `$single` is false. 503 * The value of the meta field if `$single` is true. 504 * False for an invalid `$object_id` (non-numeric, zero, or negative value), 505 * or if `$meta_type` is not specified. 506 * An empty string if a valid but non-existing object ID is passed. 504 507 */ 505 508 function get_metadata( $meta_type, $object_id, $meta_key = '', $single = false ) { 506 509 $value = get_metadata_raw( $meta_type, $object_id, $meta_key, $single ); … … 521 524 * @param int $object_id ID of the object metadata is for. 522 525 * @param string $meta_key Optional. Metadata key. If not specified, retrieve all metadata for 523 526 * the specified object. Default empty. 524 * @param bool $single Optional. If true, return only the first value of the specified meta_key. 525 * This parameter has no effect if meta_key is not specified. Default false. 526 * @return mixed Single metadata value, or array of values. Null if the value does not exist. 527 * False if there's a problem with the parameters passed to the function. 527 * @param bool $single Optional. If true, return only the first value of the specified `$meta_key`. 528 * This parameter has no effect if `$meta_key` is not specified. Default false. 529 * @return mixed An array of values if `$single` is false. 530 * The value of the meta field if `$single` is true. 531 * False for an invalid `$object_id` (non-numeric, zero, or negative value), 532 * or if `$meta_type` is not specified. 533 * Null if the value does not exist. 528 534 */ 529 535 function get_metadata_raw( $meta_type, $object_id, $meta_key = '', $single = false ) { 530 536 if ( ! $meta_type || ! is_numeric( $object_id ) ) { … … 608 614 * or any other object type with an associated meta table. 609 615 * @param int $object_id ID of the object metadata is for. 610 616 * @param string $meta_key Metadata key. 611 * @param bool $single Optional. If true, return only the first value of the specified meta_key. 612 * This parameter has no effect if meta_key is not specified. Default false. 613 * @return mixed Single metadata value, or array of values. 617 * @param bool $single Optional. If true, return only the first value of the specified `$meta_key`. 618 * This parameter has no effect if `$meta_key` is not specified. Default false. 619 * @return mixed An array of default values if `$single` is false. 620 * The default value of the meta field if `$single` is true. 614 621 */ 615 622 function get_metadata_default( $meta_type, $object_id, $meta_key, $single = false ) { 616 623 if ( $single ) { … … 1401 1408 * @param mixed $value Current value passed to filter. 1402 1409 * @param int $object_id ID of the object metadata is for. 1403 1410 * @param string $meta_key Metadata key. 1404 * @param bool $single If true, return only the first value of the specified meta_key.1405 * This parameter has no effect if meta_keyis not specified.1411 * @param bool $single If true, return only the first value of the specified `$meta_key`. 1412 * This parameter has no effect if `$meta_key` is not specified. 1406 1413 * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user', 1407 1414 * or any other object type with an associated meta table. 1408 * @return mixed Single metadata default, or array of defaults. 1415 * @return mixed An array of default values if `$single` is false. 1416 * The default value of the meta field if `$single` is true. 1409 1417 */ 1410 1418 function filter_default_metadata( $value, $object_id, $meta_key, $single, $meta_type ) { 1411 1419 global $wp_meta_keys; -
src/wp-includes/ms-site.php
1084 1084 * @param string $key Optional. The meta key to retrieve. By default, 1085 1085 * returns data for all keys. Default empty. 1086 1086 * @param bool $single Optional. Whether to return a single value. 1087 * This parameter has no effect if $keyis not specified.1087 * This parameter has no effect if `$key` is not specified. 1088 1088 * Default false. 1089 * @return mixed An array if $single is false. The value of meta data field 1090 * if $single is true. False for an invalid $site_id. 1089 * @return mixed An array of values if `$single` is false. 1090 * The value of meta data field if `$single` is true. 1091 * False for an invalid `$site_id` (non-numeric, zero, or negative value). 1092 * An empty string if a valid but non-existing site ID is passed. 1091 1093 */ 1092 1094 function get_site_meta( $site_id, $key = '', $single = false ) { 1093 1095 return get_metadata( 'blog', $site_id, $key, $single ); -
src/wp-includes/post.php
2236 2236 * @param string $key Optional. The meta key to retrieve. By default, 2237 2237 * returns data for all keys. Default empty. 2238 2238 * @param bool $single Optional. Whether to return a single value. 2239 * This parameter has no effect if $keyis not specified.2239 * This parameter has no effect if `$key` is not specified. 2240 2240 * Default false. 2241 * @return mixed An array if $single is false. The value of the meta field 2242 * if $single is true. False for an invalid $post_id. 2241 * @return mixed An array of values if `$single` is false. 2242 * The value of the meta field if `$single` is true. 2243 * False for an invalid `$post_id` (non-numeric, zero, or negative value). 2244 * An empty string if a valid but non-existing post ID is passed. 2243 2245 */ 2244 2246 function get_post_meta( $post_id, $key = '', $single = false ) { 2245 2247 return get_metadata( 'post', $post_id, $key, $single ); -
src/wp-includes/taxonomy.php
1324 1324 * @param string $key Optional. The meta key to retrieve. By default, 1325 1325 * returns data for all keys. Default empty. 1326 1326 * @param bool $single Optional. Whether to return a single value. 1327 * This parameter has no effect if $keyis not specified.1327 * This parameter has no effect if `$key` is not specified. 1328 1328 * Default false. 1329 * @return mixed An array if $single is false. The value of the meta field 1330 * if $single is true. False for an invalid $term_id. 1329 * @return mixed An array of values if `$single` is false. 1330 * The value of the meta field if `$single` is true. 1331 * False for an invalid `$term_id` (non-numeric, zero, or negative value). 1332 * An empty string if a valid but non-existing term ID is passed. 1331 1333 */ 1332 1334 function get_term_meta( $term_id, $key = '', $single = false ) { 1333 1335 return get_metadata( 'term', $term_id, $key, $single ); -
src/wp-includes/user.php
1008 1008 * @param string $key Optional. The meta key to retrieve. By default, 1009 1009 * returns data for all keys. 1010 1010 * @param bool $single Optional. Whether to return a single value. 1011 * This parameter has no effect if $keyis not specified.1011 * This parameter has no effect if `$key` is not specified. 1012 1012 * Default false. 1013 * @return mixed An array if $single is false. The value of meta data field 1014 * if $single is true. False for an invalid $user_id. 1013 * @return mixed An array of values if `$single` is false. 1014 * The value of meta data field if `$single` is true. 1015 * False for an invalid `$user_id` (non-numeric, zero, or negative value). 1016 * An empty string if a valid but non-existing user ID is passed. 1015 1017 */ 1016 1018 function get_user_meta( $user_id, $key = '', $single = false ) { 1017 1019 return get_metadata( 'user', $user_id, $key, $single );