Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories

Register::set_mode()publicWC 1.0

Sets the mode. This effectively controls if approved directories are enforced or not.

May be one of: 'disabled', 'enabled', 'migrating'.

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

Хуков нет.

Возвращает

true|false.

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

$Register = new Register();
$Register->set_mode( $mode ): bool;
$mode(строка) (обязательный)
One of the values contained within self::MODES.

Код Register::set_mode() WC 8.7.0

public function set_mode( string $mode ): bool {
	if ( ! in_array( $mode, self::MODES, true ) ) {
		return false;
	}

	update_option( $this->mode_option, $mode );
	return get_option( $this->mode_option ) === $mode;
}