Fixing SQL syntax in woo.._product_ordering().

Your sql syntax not good, please check my fix.

Thanks you. ;]
Yakir.
This commit is contained in:
Yakir Sitbon 2012-12-04 15:15:01 +02:00
parent 75c37ed2ed
commit 6bc3598586
1 changed files with 6 additions and 6 deletions

View File

@ -1819,13 +1819,13 @@ function woocommerce_product_ordering() {
$nextid = isset( $_POST['nextid'] ) ? $_POST['nextid'] : false;
$new_pos = array(); // store new positions for ajax
$siblings = $wpdb->get_results( $wpdb->prepare("
SELECT ID, menu_order FROM %s AS posts
WHERE posts.post_type = 'product'
AND posts.post_status IN ( 'publish', 'pending', 'draft', 'future', 'private' )
AND posts.ID NOT IN (%s)
$siblings = $wpdb->get_results( $wpdb->prepare('
SELECT ID, menu_order FROM %1$s AS posts
WHERE posts.post_type = \'product\'
AND posts.post_status IN ( \'publish\', \'pending\', \'draft\', \'future\', \'private\' )
AND posts.ID NOT IN (%2$d)
ORDER BY posts.menu_order ASC, posts.ID DESC
"), $wpdb->posts, $post->ID );
', $wpdb->posts, $post->ID) );
$menu_order = 0;