Warning: This method has been deprecated. Download id is now a static UUID and should not be changed based on file hash instead.

WC_Customer_Download_Data_Store::update_download_id( int $product_id, string $old_id, string $new_id )

Update download ids if the hash changes.


Description Description


Parameters Parameters

$product_id

(Required) Product ID.

$old_id

(Required) Old download_id.

$new_id

(Required) New download_id.


Top ↑

Source Source

File: includes/data-stores/class-wc-customer-download-data-store.php

	public function update_download_id( $product_id, $old_id, $new_id ) {
		global $wpdb;

		wc_deprecated_function( __METHOD__, '3.3' );

		$wpdb->update(
			$wpdb->prefix . 'woocommerce_downloadable_product_permissions',
			array(
				'download_id' => $new_id,
			),
			array(
				'download_id' => $old_id,
				'product_id'  => $product_id,
			)
		);
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.