WPDev.one
Core Function
View Source on Trac ↗

get_post_type()

get_post_type( mixed $post = null )

Retrieves the post type of the current post or of a given post.

Parameters 1 required

Name / Type Description
(int

| WP_Post | null) $post Optional. Post ID or post object. Default is global $post.

Required

Return Value

((string)
| false) Post type on success, false on failure.

Function Information

Since Version
2.1.0
Source File
wp-includes/post.php
Advertisement