Fix undefined vars

This commit is contained in:
Mike Jolley 2011-11-14 13:57:12 +00:00
parent 63e785c015
commit 68d8a465b6
4 changed files with 8 additions and 7 deletions

View File

@ -480,7 +480,7 @@ function woocommerce_downloads_upload_dir( $pathdata ) {
$args = wp_parse_args( $_SERVER['HTTP_REFERER'] );
extract( $args, EXTR_SKIP );
if ($from =='wc01') :
if (isset($from) && $from =='wc01') :
// Uploading a downloadable file
$subdir = '/woocommerce_uploads'.$pathdata['subdir'];

View File

@ -855,9 +855,9 @@ endif;
function woocommerce_shop_order_search_custom_fields( $wp ) {
global $pagenow, $wpdb;
if( 'edit.php' != $pagenow ) return $query;
if( !isset( $wp->query_vars['s'] ) || !$wp->query_vars['s'] ) return $query;
if ($wp->query_vars['post_type']!='shop_order') return $query;
if( 'edit.php' != $pagenow ) return $wp;
if( !isset( $wp->query_vars['s'] ) || !$wp->query_vars['s'] ) return $wp;
if ($wp->query_vars['post_type']!='shop_order') return $wp;
$search_fields = array(
'_billing_first_name',

View File

@ -454,7 +454,7 @@ class woocommerce_product {
if ( $this->has_child() ) :
foreach ($this->get_children() as $child_id) :
if ( get_post_meta( $child_id, 'price', true) == $child->price ) return true;
if ( get_post_meta( $child_id, 'price', true) == $this->price ) return true;
endforeach;
else :
@ -720,7 +720,7 @@ class woocommerce_product {
function has_attributes() {
if (sizeof($this->get_attributes())>0) :
foreach ($this->get_attributes() as $attribute) :
if ($attribute['is_visible']) return true;
if (isset($attribute['is_visible']) && $attribute['is_visible']) return true;
endforeach;
endif;
return false;
@ -736,7 +736,7 @@ class woocommerce_product {
echo '<table cellspacing="0" class="shop_attributes">';
$alt = 1;
foreach ($attributes as $attribute) :
if (!$attribute['is_visible']) continue;
if (!isset($attribute['is_visible']) || !$attribute['is_visible']) continue;
$alt = $alt*-1;
echo '<tr class="';

View File

@ -91,6 +91,7 @@ Yes you can! Join in on our GitHub repository :) https://github.com/woothemes/wo
* Removed subcats when paged
* Category widget now supports hierarchy/counts
* woocommerce-page body class for *all* woocommerce pages
* Lots of minor fixes and optimisations
= 1.2.1 - 10/11/2011 =
* Reworked downloadable and virtual products - now variations can be downloadable/virtual too making it more flexible