get_post_custom( int $post_id )
Retrieve post meta fields, based on post ID.
Description Description
The post meta fields are retrieved from the cache where possible, so the function is optimized to be called more than once.
Parameters Parameters
- $post_id
-
(int) (Optional) Post ID. Default is ID of the global $post.
Return Return
(array) Post meta for the given post.
More Information More Information
See also get_post_custom_keys() and get_post_custom_values()
Source Source
File: wp-includes/post.php
2217 2218 2219 2220 2221 2222 2223 2224 |
function get_post_custom( $post_id = 0 ) { $post_id = absint( $post_id ); if ( ! $post_id ) { $post_id = get_the_ID(); } return get_post_meta( $post_id ); } |
View on Trac
Changelog Changelog
Version | Description |
---|---|
1.2.0 | Introduced. |