Uses
Uses | Description |
---|---|
wp-includes/post.php: get_post_custom() | Retrieve post meta fields, based on post ID. |
Retrieve post custom meta data field.
(string) (Optional) Meta data key name.
Default value: ''
(array|string|false) Array of values, or single value if only one element exists. False if the key does not exist.
File: wp-includes/post-template.php
function post_custom( $key = '' ) { $custom = get_post_custom(); if ( ! isset( $custom[ $key ] ) ) { return false; } elseif ( 1 === count( $custom[ $key ] ) ) { return $custom[ $key ][0]; } else { return $custom[ $key ]; } }
Version | Description |
---|---|
1.5.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/post_custom