Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Admin

UI::process_all_actions()privateWC 1.0

Handles the enable/disable-all actions.

Method of the class: UI{}

No Hooks.

Return

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->process_all_actions( $action );
$action(string) (required)
The action to be applied.

UI::process_all_actions() code WC 8.7.0

private function process_all_actions( string $action ) {
	$register = wc_get_container()->get( Register::class );
	$redirect = $this->table->get_base_url();

	switch ( $action ) {
		case 'enable-all':
			$redirect = add_query_arg( 'enabled-all', (int) $register->enable_all(), $redirect );
			break;

		case 'disable-all':
			$redirect = add_query_arg( 'disabled-all', (int) $register->disable_all(), $redirect );
			break;
	}

	wp_safe_redirect( $redirect );
		exit;
}