WP_Post_Type::__construct()
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
. Ничего.
Использование
$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.
По умолчанию: empty array
Заметки
- Смотрите: register_post_type()
Список изменений
С версии 4.6.0 | Введена. |
Код WP_Post_Type::__construct() WP Post Type:: construct WP 6.2.2
public function __construct( $post_type, $args = array() ) { $this->name = $post_type; $this->set_props( $args ); }