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.
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,
)
);
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |