From b7a5c75686bf8fca8500e1cd4b5d231a7fa0fa32 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 10:13:50 +0000 Subject: [PATCH] Docs: Document that various metadata functions return false for an invalid ID. Props salcode. See #40519. git-svn-id: https://develop.svn.wordpress.org/trunk@48658 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 2 +- src/wp-includes/ms-site.php | 2 +- src/wp-includes/post.php | 2 +- src/wp-includes/taxonomy.php | 2 +- src/wp-includes/user.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 93ff1876dc..efcf384815 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -496,7 +496,7 @@ function delete_comment_meta( $comment_id, $meta_key, $meta_value = '' ) { * This parameter has no effect if $key is not specified. * Default false. * @return mixed An array if $single is false. The value of meta data field - * if $single is true. + * if $single is true. False for an invalid $comment_id. */ function get_comment_meta( $comment_id, $key = '', $single = false ) { return get_metadata( 'comment', $comment_id, $key, $single ); diff --git a/src/wp-includes/ms-site.php b/src/wp-includes/ms-site.php index 7070baefd9..b90dde3cd0 100644 --- a/src/wp-includes/ms-site.php +++ b/src/wp-includes/ms-site.php @@ -1087,7 +1087,7 @@ function delete_site_meta( $site_id, $meta_key, $meta_value = '' ) { * This parameter has no effect if $key is not specified. * Default false. * @return mixed An array if $single is false. The value of meta data field - * if $single is true. + * if $single is true. False for an invalid $site_id. */ function get_site_meta( $site_id, $key = '', $single = false ) { return get_metadata( 'blog', $site_id, $key, $single ); diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 9a1aaeeb64..d92d9617f2 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2120,7 +2120,7 @@ function delete_post_meta( $post_id, $meta_key, $meta_value = '' ) { * This parameter has no effect if $key is not specified. * Default false. * @return mixed An array if $single is false. The value of the meta field - * if $single is true. + * if $single is true. False for an invalid $post_id. */ function get_post_meta( $post_id, $key = '', $single = false ) { return get_metadata( 'post', $post_id, $key, $single ); diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index e07e783528..69355a3fb0 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -1292,7 +1292,7 @@ function delete_term_meta( $term_id, $meta_key, $meta_value = '' ) { * This parameter has no effect if $key is not specified. * Default false. * @return mixed An array if $single is false. The value of the meta field - * if $single is true. + * if $single is true. False for an invalid $term_id. */ function get_term_meta( $term_id, $key = '', $single = false ) { return get_metadata( 'term', $term_id, $key, $single ); diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php index 28f1583a90..4994563d08 100644 --- a/src/wp-includes/user.php +++ b/src/wp-includes/user.php @@ -831,7 +831,7 @@ function delete_user_meta( $user_id, $meta_key, $meta_value = '' ) { * This parameter has no effect if $key is not specified. * Default false. * @return mixed An array if $single is false. The value of meta data field - * if $single is true. + * if $single is true. False for an invalid $user_id. */ function get_user_meta( $user_id, $key = '', $single = false ) { return get_metadata( 'user', $user_id, $key, $single );