Automattic\WooCommerce\Internal\Admin\Orders

PageController::setup()publicWC 1.0

Sets up the page controller, including registering the menu item.

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

Хуков нет.

Возвращает

null. Ничего.

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

$PageController = new PageController();
$PageController->setup(): void;

Код PageController::setup() WC 6.9.4

public function setup(): void {
	// Register menu.
	if ( 'admin_menu' === current_action() ) {
		$this->register_menu();
	} else {
		add_action( 'admin_menu', 'register_menu', 9 );
	}

	$this->set_action();

	// Perform initialization for the current action.
	add_action(
		'load-woocommerce_page_wc-orders',
		function() {
			if ( method_exists( $this, 'setup_action_' . $this->current_action ) ) {
				$this->{"setup_action_{$this->current_action}"}();
			}
		}
	);
}