Fix for previous commit

This commit is contained in:
Mike Jolley 2012-10-04 18:33:35 +01:00
parent dd4ce13455
commit 7c724f4ea4
1 changed files with 7 additions and 2 deletions

View File

@ -617,7 +617,7 @@ function woocommerce_revoke_access_to_download() {
$product_id = intval( $_POST['product_id'] );
$order_id = intval( $_POST['order_id'] );
$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE order_id = %d AND product_id = %d AND download_id = %d;" $wpdb->prefix . 'woocommerce_downloadable_product_permissions', $order_id, $product_id, $download_id ) );
$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE order_id = %d AND product_id = %d AND download_id = %d;", $order_id, $product_id, $download_id ) );
die();
}
@ -1454,7 +1454,12 @@ function woocommerce_product_image_ordering() {
$menu_order++;
}
}
// Set featured image
$new_positions = array_flip( $new_positions );
if ( isset( $new_positions[0] ) )
update_post_meta( $post_id, '_thumbnail_id', $new_positions[0] );
die();
}