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.
Hands off the keyboard. Web development starts by thinking first, then planning it out, and then coding it.
More coming soon…keep checking back.