Automattic\WooCommerce\Internal\Admin\Orders

PageController::set_action()privateWC 1.0

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

Method of the class: PageController{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->set_action(): void;

PageController::set_action() code WC 7.1.1

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;
	}
}