Undefined index errors

Fixed undefined index errors in woocommerce query an taxonomy logic.
This commit is contained in:
Matty 2011-09-07 11:07:47 +02:00
parent cf795c1aec
commit ff87be8d68
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ function woocommerce_parse_query( $q ) {
if (is_admin()) return;
// Only apply to product categories, the product post archive, the shop page, and product tags
if (true == $q->query_vars['suppress_filters'] || (!$q->is_tax( 'product_cat' ) && !$q->is_post_type_archive( 'product' ) && !$q->is_page( get_option('woocommerce_shop_page_id') ) && !$q->is_tax( 'product_tag' ))) return;
if ( ( isset( $q->query_vars['suppress_filters'] ) && true == $q->query_vars['suppress_filters'] ) || (!$q->is_tax( 'product_cat' ) && !$q->is_post_type_archive( 'product' ) && !$q->is_page( get_option('woocommerce_shop_page_id') ) && !$q->is_tax( 'product_tag' ))) return;
$meta_query = (array) $q->get( 'meta_query' );

View File

@ -79,7 +79,7 @@ function woocommerce_post_type() {
$hierarchical = true;
if ($name) :
$label = ($tax->attribute_label) ? $tax->attribute_label : $tax->attribute_name;
$label = ( isset( $tax->attribute_label ) && $tax->attribute_label ) ? $tax->attribute_label : $tax->attribute_name;
register_taxonomy( $name,
array('product'),