Clear meta key after update. Closes #1911.

This commit is contained in:
Mike Jolley 2012-12-05 15:21:31 +00:00
parent a6a685fd6e
commit c47b135ff5
1 changed files with 3 additions and 0 deletions

View File

@ -29,8 +29,11 @@ if ( $existing_file_paths ) {
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->postmeta} SET meta_key = '_file_paths', meta_value = %s WHERE meta_id = %d", $file_paths, $existing_file_path->meta_id ) );
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}woocommerce_downloadable_product_permissions SET download_id = %s WHERE product_id = %d", md5( $existing_file_path->meta_value ), $existing_file_path->post_id ) );
}
// Rename old key
$wpdb->query( "UPDATE {$wpdb->postmeta} SET meta_key = '_file_path_backup' WHERE meta_key = '_file_path'" );
}
// Update table primary keys