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

Метод класса: WP_Post_Type{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_Post_Type = new WP_Post_Type();
$WP_Post_Type->__construct( $post_type, $args );
$post_type(строка) (обязательный)
Post type key.
$args(массив|строка)
Array or string of arguments for registering a post type. See register_post_type() for information on accepted arguments.
По умолчанию: empty array

Заметки

Список изменений

С версии 4.6.0 Введена.

Код WP_Post_Type::__construct() WP 6.5.2

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

	$this->set_props( $args );
}