Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

get_post_field()

3 tags 1 category

get_post_field() — Retrieves data from a post field based on Post ID. Examples of the post field will be, ‘post_type’, ‘post_status’, ‘post_content’, etc and based off of the post object property or key names. The context values are based off of the taxonomy filter functions and supported values are found within those functions.

Inputs: $field (string): Post field name. $post (int|WP_Post): Optional. Post ID or post object. Defaults to global $post. $context (string): Optional. How to filter the field. Accepts ‘raw’, ‘edit’, ‘db’, or ‘display’. Default ‘display’.

Returns int|string|int[]: The value of the post field on success, empty string on failure.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…