WP_Post_Type::__construct()publicWP 4.6.0

Constructor.

See the register_post_type() function for accepted arguments for $args.

Will populate object properties from the provided arguments and assign other default properties based on that information.

Method of the class: WP_Post_Type{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Post_Type = new WP_Post_Type();
$WP_Post_Type->__construct( $post_type, $args );
$post_type(string) (required)
Post type key.
$args(array|string)
Array or string of arguments for registering a post type.
Default: empty array

Notes

Changelog

Since 4.6.0 Introduced.

WP_Post_Type::__construct() code WP 6.1.1

public function __construct( $post_type, $args = array() ) {
	$this->name = $post_type;

	$this->set_props( $args );
}