Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories

Register::disable_by_id │ public │ WC 1.0

Disable the approved directory identified by the supplied ID.

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

Хуков нет.

Возвращает

bool.

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

$Register = new Register();
$Register->disable_by_id( $id ): bool;
$id(int) (обязательный)
The ID of the rule to be deleted.

Код Register::disable_by_id() WC 11.2.2

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;
}