Docs: Update the documentation for get_post_meta() to clarify that $single has no effect when the $meta_key is not provided.

Props chetan200891, titodevera.
Fixes #42687.


git-svn-id: https://develop.svn.wordpress.org/trunk@42227 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2017-11-26 03:16:55 +00:00
parent b8c4faff72
commit d00e74042b

View File

@ -1770,7 +1770,9 @@ function delete_post_meta( $post_id, $meta_key, $meta_value = '' ) {
* @param int $post_id Post ID. * @param int $post_id Post ID.
* @param string $key Optional. The meta key to retrieve. By default, returns * @param string $key Optional. The meta key to retrieve. By default, returns
* data for all keys. Default empty. * data for all keys. Default empty.
* @param bool $single Optional. Whether to return a single value. Default false. * @param bool $single Optional, default is false.
* If true, return only the first value of the specified meta_key.
* This parameter has no effect if meta_key is not specified.
* @return mixed Will be an array if $single is false. Will be value of meta data * @return mixed Will be an array if $single is false. Will be value of meta data
* field if $single is true. * field if $single is true.
*/ */