Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories

Register::disable_allpublicWC 1.0

Disables all Approved Download Directory rules in a single operation.

Method of the class: Register{}

No Hooks.

Returns

true|false.

Usage

$Register = new Register();
$Register->disable_all(): bool;

Register::disable_all() code WC 10.8.1

public function disable_all(): bool {
	global $wpdb;

	// phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared
	if ( ! $wpdb->query( "UPDATE {$this->get_table()} SET enabled = 0" ) ) {
		return false;
	}

	unset( $this->cache );
	return true;
}