Update class-wc-admin-duplicate-product.php

Initialize `$sql_query_sel` before loop - to avoid code validation warning.
This commit is contained in:
Gregory Karpinsky 2014-04-05 13:16:46 -04:00 committed by Mike Jolley
parent 3ac0005eec
commit 5d8ace5d81
1 changed files with 1 additions and 0 deletions

View File

@ -221,6 +221,7 @@ class WC_Admin_Duplicate_Product {
$post_meta_infos = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$id"); $post_meta_infos = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$id");
if (count($post_meta_infos)!=0) { if (count($post_meta_infos)!=0) {
$sql_query_sel = array();
$sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) "; $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
foreach ($post_meta_infos as $meta_info) { foreach ($post_meta_infos as $meta_info) {
$meta_key = $meta_info->meta_key; $meta_key = $meta_info->meta_key;