WPDev.one
Core Function
View Source on Trac ↗

get_post_type_object()

get_post_type_object( mixed $post_type )

Retrieves a post type object by name.

Parameters 1 required

Name / Type Description
$post_type
string

The name of a registered post type.

Required

Return Value

((WP_Post_Type)
| null) WP_Post_Type object if it exists, null otherwise.

Function Information

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