WP_Terms_List_Table::__construct
Constructor.
Метод класса: WP_Terms_List_Table{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WP_Terms_List_Table = new WP_Terms_List_Table(); $WP_Terms_List_Table->__construct( $args );
- $args(массив)
- An associative array of arguments.
По умолчанию:array()
Заметки
| Смотрите: WP_List_Table::__construct() for more information on default arguments. |
Global. Строка. $post_type Global post type. |
Global. Строка. $taxonomy Global taxonomy. |
Global. Строка. $action |
Global. WP_Taxonomy. $tax Global taxonomy object. |
Список изменений
| С версии 3.1.0 | Введена. |
Код WP_Terms_List_Table::__construct() WP Terms List Table:: construct WP 7.1.4
public function __construct( $args = array() ) {
global $post_type, $taxonomy, $action, $tax;
parent::__construct(
array(
'plural' => 'tags',
'singular' => 'tag',
'screen' => $args['screen'] ?? null,
)
);
$action = $this->screen->action;
$post_type = $this->screen->post_type;
$taxonomy = $this->screen->taxonomy;
if ( empty( $taxonomy ) ) {
$taxonomy = 'post_tag';
}
if ( ! taxonomy_exists( $taxonomy ) ) {
wp_die( __( 'Invalid taxonomy.' ) );
}
$tax = get_taxonomy( $taxonomy );
// @todo Still needed? Maybe just the show_ui part.
if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ), true ) ) {
$post_type = 'post';
}
}