Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories

Register::disable_by_idpublicWC 1.0

Disable the approved directory identitied by the supplied ID.

Method of the class: Register{}

No Hooks.

Returns

true|false.

Usage

$Register = new Register();
$Register->disable_by_id( $id ): bool;
$id(int) (required)
The ID of the rule to be deleted.

Register::disable_by_id() code WC 10.8.1

public function disable_by_id( int $id ): bool {
	global $wpdb;

	if ( ! $wpdb->update( $this->get_table(), array( 'enabled' => 0 ), array( 'url_id' => $id ) ) ) {
		return false;
	}

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