The post meta fields are retrieved from the cache where possible, so the function is optimized to be called more than once.
Parameters
$post_idintoptional
Post ID. Default is the ID of the global $post.Default: 0
Return
array<string,
array<int, string>>|false Array of post meta values keyed by meta key, or false on failure. Post meta values will always be strings, even for values which would otherwise be retrieved individually as arrays or objects via get_post_meta(). An empty array is returned if the post has no post meta.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Return type changed from mixed to array<string,.verified against source
1.2.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/post.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.