Automattic\WooCommerce\Internal\ProductDownloads\ApprovedDirectories

Register::enable_by_id │ public │ WC 1.0

Enable the approved directory identified by the supplied ID.

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

Хуков нет.

Возвращает

bool.

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

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

Код Register::enable_by_id() WC 11.2.2

public function enable_by_id( int $id ): bool {
	global $wpdb;
	$table = $this->get_table();

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

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