Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories
Register::set_mode
Sets the mode. This effectively controls if approved directories are enforced or not.
May be one of: 'disabled', 'enabled', 'migrating'.
Method of the class: Register{}
No Hooks.
Returns
true|false.
Usage
$Register = new Register(); $Register->set_mode( $mode ): bool;
- $mode(string) (required)
- One of the values contained within self::MODES.
Register::set_mode() Register::set mode code WC 10.5.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;
}