😆get post field get_post_field Retrieve data from a post field based on Post ID (ok)

https://developer.wordpress.org/reference/functions/get_post_field/

Here are the default post fields that you can get (case-sensitive)

ID
post_author
post_date
post_date_gmt
post_content
post_title
post_excerpt
post_status
comment_status
ping_status
post_password
post_name
to_ping
pinged
post_modified
post_modified_gmt
post_content_filtered
post_parent
guid
menu_order
post_type
post_mime_type
comment_count
filter
$author_id = get_post_field( 'post_author', $post_id );
$author    = get_the_author_meta( 'display_name', $author_id );</code>

Last updated