WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Admin_Post_Types::setup_screen() public WC 3.3.0

Looks at the current screen and loads the correct list table handler.

Это метод класса: WC_Admin_Post_Types{}

Хуков нет.

Возвращает

Null. Ничего.

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

$WC_Admin_Post_Types = new WC_Admin_Post_Types();
$WC_Admin_Post_Types->setup_screen();

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

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

Код WC_Admin_Post_Types::setup_screen() WC 4.5.2

woocommerce/includes/admin/class-wc-admin-post-types.php
<?php
public function setup_screen() {
	global $wc_list_table;

	$request_data = $this->request_data();

	$screen_id = false;

	if ( function_exists( 'get_current_screen' ) ) {
		$screen    = get_current_screen();
		$screen_id = isset( $screen, $screen->id ) ? $screen->id : '';
	}

	if ( ! empty( $request_data['screen'] ) ) {
		$screen_id = wc_clean( wp_unslash( $request_data['screen'] ) );
	}

	switch ( $screen_id ) {
		case 'edit-shop_order':
			include_once 'list-tables/class-wc-admin-list-table-orders.php';
			$wc_list_table = new WC_Admin_List_Table_Orders();
			break;
		case 'edit-shop_coupon':
			include_once 'list-tables/class-wc-admin-list-table-coupons.php';
			$wc_list_table = new WC_Admin_List_Table_Coupons();
			break;
		case 'edit-product':
			include_once 'list-tables/class-wc-admin-list-table-products.php';
			$wc_list_table = new WC_Admin_List_Table_Products();
			break;
	}

	// Ensure the table handler is only loaded once. Prevents multiple loads if a plugin calls check_ajax_referer many times.
	remove_action( 'current_screen', array( $this, 'setup_screen' ) );
	remove_action( 'check_ajax_referer', array( $this, 'setup_screen' ) );
}