get_post_meta


get_post_meta ( $post_id, $key = '', $single = false )

Parameters:
  • (int) $post_id Post ID.
  • (string) $key Optional. The meta key to retrieve. By default, returns data for all keys. Default empty.
  • (bool) $single Optional. If true, returns only the first value for the specified meta key. This parameter has no effect if $key is not specified. Default false.
Returns:
  • (mixed) Will be an array if $single is false. Will be value of the meta field if $single is true.
Defined at:

Description

Retrieves a post meta field for the given post ID.

Related Functions

get_post_time, get_site_meta, delete_post_meta, get_post_stati, get_post_meta_by_id

Top Google Results

User discussions

wpseek mobile