The What
Description
This construct (function) gets the post type for the given post. If you do not pass it a post, then it will use the current global $post
. Otherwise, you can specify the one you want to check by passing in the post ID (integer) or the post object (instance of WP_Post). If the post exists, it will return its post type; else, false is returned.
Parameters
post
- (Optional) Post ID or post object to be checked.
Return Values
If the post exists, it returns its post type, i.e. from the post_type
column in the database. Else false
is returned.
Once upon a time, there was a developer... You! This is going to be a good story...
More coming soon…keep checking back.