Automattic\WooCommerce\Internal\Admin\Orders

ListTable::setup()publicWC 1.0

Performs setup work required before rendering the table.

Method of the class: ListTable{}

No Hooks.

Return

null. Nothing (null).

Usage

$ListTable = new ListTable();
$ListTable->setup( $args ): void;
$args(array)
Args to initialize this list table.
Default: array()

ListTable::setup() code WC 8.7.0

public function setup( $args = array() ): void {
	$this->order_type = $args['order_type'] ?? 'shop_order';

	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, '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 );
}