WP_Post_Type::__construct( string $post_type, array|string $args = array() )

Constructor.


Description

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.

Top ↑

See also


Top ↑

Parameters

$post_type string Required
Post type key.
$args array|string Optional
Array or string of arguments for registering a post type.

Default: array()


Top ↑

Source

File: wp-includes/class-wp-post-type.php. View all references

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

	$this->set_props( $args );
}


Top ↑

Changelog

Changelog
Version Description
4.6.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.