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.

See also

Parameters

$post_typestringrequired
Post type key.
$argsarray|stringoptional
Array or string of arguments for registering a post type.
See register_post_type() for information on accepted arguments.
More Arguments from register_post_type( … $args )Post type registration arguments.

Default:array()

Source

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

	$this->set_props( $args );
}

Changelog

VersionDescription
4.6.0Introduced.

User Contributed Notes

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