From 859558fd3bbec17c64ef1f53cef88a457839618f Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 19 Jul 2013 15:02:36 +0100 Subject: [PATCH] isset for vars which are not always present. Closes #3494 --- .../writepanel-product-type-variable.php | 21 +++++++------------ woocommerce-core-functions.php | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/admin/post-types/writepanels/writepanel-product-type-variable.php b/admin/post-types/writepanels/writepanel-product-type-variable.php index 3c8330c5630..33cfdd71ea2 100755 --- a/admin/post-types/writepanels/writepanel-product-type-variable.php +++ b/admin/post-types/writepanels/writepanel-product-type-variable.php @@ -649,11 +649,6 @@ function process_product_meta_variable( $post_id ) { $variable_post_id = $_POST['variable_post_id']; $variable_sku = $_POST['variable_sku']; - $variable_weight = $_POST['variable_weight']; - $variable_length = $_POST['variable_length']; - $variable_width = $_POST['variable_width']; - $variable_height = $_POST['variable_height']; - $variable_stock = $_POST['variable_stock']; $variable_regular_price = $_POST['variable_regular_price']; $variable_sale_price = $_POST['variable_sale_price']; $upload_image_id = $_POST['upload_image_id']; @@ -666,14 +661,14 @@ function process_product_meta_variable( $post_id ) { $variable_sale_price_dates_from = $_POST['variable_sale_price_dates_from']; $variable_sale_price_dates_to = $_POST['variable_sale_price_dates_to']; - if ( isset( $_POST['variable_enabled'] ) ) - $variable_enabled = $_POST['variable_enabled']; - - if ( isset( $_POST['variable_is_virtual'] ) ) - $variable_is_virtual = $_POST['variable_is_virtual']; - - if ( isset( $_POST['variable_is_downloadable'] ) ) - $variable_is_downloadable = $_POST['variable_is_downloadable']; + $variable_weight = isset( $_POST['variable_weight'] ) ? $_POST['variable_weight'] : array(); + $variable_length = isset( $_POST['variable_length'] ) ? $_POST['variable_length'] : array(); + $variable_width = isset( $_POST['variable_width'] ) ? $_POST['variable_width'] : array(); + $variable_height = isset( $_POST['variable_height'] ) ? $_POST['variable_height'] : array(); + $variable_stock = isset( $_POST['variable_stock'] ) ? $_POST['variable_stock'] : array(); + $variable_enabled = isset( $_POST['variable_enabled'] ) ? $_POST['variable_enabled'] : array(); + $variable_is_virtual = isset( $_POST['variable_is_virtual'] ) ? $_POST['variable_is_virtual'] : array(); + $variable_is_downloadable = isset( $_POST['variable_is_downloadable'] ) ? $_POST['variable_is_downloadable'] : array(); $attributes = (array) maybe_unserialize( get_post_meta( $post_id, '_product_attributes', true ) ); diff --git a/woocommerce-core-functions.php b/woocommerce-core-functions.php index 168e610edb5..c73928d5880 100644 --- a/woocommerce-core-functions.php +++ b/woocommerce-core-functions.php @@ -2586,7 +2586,7 @@ function woocommerce_cancel_unpaid_orders() { WHERE posts.post_type = 'shop_order' AND posts.post_status = 'publish' AND tax.taxonomy = 'shop_order_status' - AND term.slug IN ('pending') + AND term.slug = 'pending' AND posts.post_modified < %s ", $date ) );