Retrieve post meta field for a post.
Signature
get_post_meta( $post_id, $key = '', $single = false )
- post_id
- (int) Post ID.
- key
- (string) Optional. The meta key to retrieve. By default, returns data for all keys.
Default:'' - single
- (boolean) Whether to return a single value.
Default:false
Return
(mixed) Will be an array if $single is false. Will be value of meta data field if $single is true.
Source
function get_post_meta($post_id, $key = '', $single = false) {
return get_metadata('post', $post_id, $key, $single);
}
WP Trac GitHub Bitbucket
Link here
-
URL
http://queryposts.com/function/get_post_meta/ -
HTML
<a href='http://queryposts.com/function/get_post_meta/'>get_post_meta()</a> -
Markdown
[get_post_meta()](http://queryposts.com/function/get_post_meta/) -
BBCode
[url=http://queryposts.com/function/get_post_meta/]get_post_meta()[/url]