WordPress at a glance
function is not described

WP_Post_Type::__construct() WP 4.6.0

Constructor.

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

This is a method of the class: WP_Post_Type

No Hooks.

Return

Null. Nothing.

Usage

$WP_Post_Type = new WP_Post_Type();
$var = $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

  • See: register_post_type()

Changelog

Since 4.6.0 Introduced.

Code of WP Post Type:: construct: wp-includes/class-wp-post-type.php WP 5.2.2

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

	$this->set_props( $args );
}