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).

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

Хуков нет.

Возвращает

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

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

// private - только в коде основоного (родительского) класса
$result = $this->process_on_off( $action );
$action(строка) (обязательный)
Whether the feature should be turned on or off.

Код UI::process_on_off() WC 8.7.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;
	}
}