get_post_type( integer|WP_Post|null $post = null );
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.
- (Optional) Post ID or post object to be checked.
If the post exists, it returns its post type, i.e. from the
post_type column in the database. Else
false is returned.
Don’t repeat yourself. Don’t repeat yourself. Don’t repeat yourself.
More coming soon…keep checking back.