Automattic\WooCommerce\Internal\Admin\Orders

PageController::set_action()privateWC 1.0

Sets the current action based on querystring arguments. Defaults to 'list_orders'.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// private - только в коде основоного (родительского) класса
$result = $this->set_action(): void;

Код PageController::set_action() WC 8.7.0

private function set_action(): void {
	switch ( isset( $_GET['action'] ) ? sanitize_text_field( wp_unslash( $_GET['action'] ) ) : '' ) {
		case 'edit':
			$this->current_action = 'edit_order';
			break;
		case 'new':
			$this->current_action = 'new_order';
			break;
		default:
			$this->current_action = 'list_orders';
			break;
	}
}