WordPress at Your Fingertips
function is not described

WP_Post_Type::__construct() public WP 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.

{} It's a 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.

Code of WP_Post_Type::__construct() WP 5.8.1

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

	$this->set_props( $args );
}