Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories\Admin

UI::process_on_off()privateWC 1.0

Handles turning on/off the entire approved download directory system (vs enabling and disabling of individual rules).

Method of the class: UI{}

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->process_on_off( $action );
$action(string) (required)
Whether the feature should be turned on or off.

UI::process_on_off() code WC 7.1.0

private function process_on_off( string $action ) {
	switch ( $action ) {
			case 'turn-on':
				$this->register->set_mode( Register::MODE_ENABLED );
				break;

		case 'turn-off':
			$this->register->set_mode( Register::MODE_DISABLED );
			break;
	}
}