WPDev.one
Core Function
View Source on Trac ↗

register_post_type()

register_post_type( mixed $post_type, mixed $args = array() )

Registers a post type.

Parameters 2 required

Name / Type Description
string

$post_type Post type key. Must not exceed 20 characters and may only contain lowercase alphanumeric characters, dashes, and underscores. See sanitize_key().

Required
mixed

(array | string) $args { Array or string of arguments for registering a post type.

Required

Return Value

((WP_Post_Type)
(WP_Post_Type | WP_Error) The registered post type object on success, WP_Error object on failure.

Function Information

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