Skip to content

Commit 9e4cb58

Browse files
committed
Docs: Improve accuracy of @return type and description for get_post_custom().
Developed in WordPress#10996 Follow-up to [52795]. Props ravikhadka, westonruter, swissspidy, roytanck. See #64224, #55249. Fixes #60646. git-svn-id: https://develop.svn.wordpress.org/trunk@61718 602fd350-edb4-49c9-b593-d223f7449a82
1 parent dc64903 commit 9e4cb58

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/wp-includes/post.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2828,9 +2828,11 @@ function unregister_post_meta( $post_type, $meta_key ) {
28282828
* @since 1.2.0
28292829
*
28302830
* @param int $post_id Optional. Post ID. Default is the ID of the global `$post`.
2831-
* @return mixed An array of values.
2832-
* False for an invalid `$post_id` (non-numeric, zero, or negative value).
2833-
* An empty string if a valid but non-existing post ID is passed.
2831+
* @return array<string, array<int, string>>|false Array of post meta values keyed by meta key, or false on failure.
2832+
* Post meta values will always be strings, even for values which would
2833+
* otherwise be retrieved individually as arrays or objects via
2834+
* {@see get_post_meta()}. An empty array is returned if the post has
2835+
* no post meta.
28342836
*/
28352837
function get_post_custom( $post_id = 0 ) {
28362838
$post_id = absint( $post_id );

0 commit comments

Comments
 (0)