Automattic\WooCommerce\Internal\Admin\Orders
ListTable::setup
Performs setup work required before rendering the table.
Метод класса: ListTable{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$ListTable = new ListTable(); $ListTable->setup( $args ): void;
- $args(массив)
- Args to initialize this list table.
По умолчанию: array()
Код ListTable::setup() ListTable::setup WC 10.3.5
public function setup( $args = array() ): void {
$this->order_type = $args['order_type'] ?? 'shop_order';
$this->wp_post_type = get_post_type_object( $this->order_type );
add_action( 'admin_notices', array( $this, 'bulk_action_notices' ) );
add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
add_filter( 'set_screen_option_edit_' . $this->order_type . '_per_page', array( $this, 'set_items_per_page' ), 10, 3 );
add_filter( 'default_hidden_columns', array( $this, 'default_hidden_columns' ), 10, 2 );
add_action( 'admin_footer', array( $this, 'enqueue_scripts' ) );
add_action( 'woocommerce_order_list_table_restrict_manage_orders', array( $this, 'created_via_filter' ) );
add_action( 'woocommerce_order_list_table_restrict_manage_orders', array( $this, 'customers_filter' ) );
$this->items_per_page();
set_screen_options();
add_action( 'manage_' . wc_get_page_screen_id( $this->order_type ) . '_custom_column', array( $this, 'render_column' ), 10, 2 );
}