WC_Customer_Download_Data_Store::update_download_id()
Deprecated from version 3.3.0 Download id is now a static UUID and should not be changed based on file hash.. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.
Update download ids if the hash changes.
Method of the class: WC_Customer_Download_Data_Store{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Customer_Download_Data_Store = new WC_Customer_Download_Data_Store(); $WC_Customer_Download_Data_Store->update_download_id( $product_id, $old_id, $new_id );
- $product_id(int) (required)
- Product ID.
- $old_id(string) (required)
- Old download_id.
- $new_id(string) (required)
- New download_id.
Changelog
Deprecated since 3.3.0 | Download id is now a static UUID and should not be changed based on file hash. |
WC_Customer_Download_Data_Store::update_download_id() WC Customer Download Data Store::update download id code WC 9.4.2
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, ) ); }