WP_Post_Type::__construct

Advertisement

Summery Summery

Constructor.

Syntax Syntax

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

Description Description

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

Parameters Parameters

$post_type

(Required) Post type key.

$args

(Optional) Array or string of arguments for registering a post type.

Default value: array()

Source Source

File: wp-includes/class-wp-post-type.php

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

		$this->set_props( $args );
	}

Advertisement

Changelog Changelog

Changelog
Version Description
4.6.0 Introduced.

See also See also

Advertisement

Leave a Reply