From 9759d3826562039a9922e34b1d400116eb63dfcd Mon Sep 17 00:00:00 2001 From: Nicola Mustone Date: Fri, 29 Jul 2016 11:51:58 +0200 Subject: [PATCH 1/2] coding standards and escaping --- .../class-product-cat-dropdown-walker.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/walkers/class-product-cat-dropdown-walker.php b/includes/walkers/class-product-cat-dropdown-walker.php index 9e88bf608c1..5ee5bd32450 100644 --- a/includes/walkers/class-product-cat-dropdown-walker.php +++ b/includes/walkers/class-product-cat-dropdown-walker.php @@ -47,26 +47,26 @@ class WC_Product_Cat_Dropdown_Walker extends Walker { */ public function start_el( &$output, $cat, $depth = 0, $args = array(), $current_object_id = 0 ) { - if ( ! empty( $args['hierarchical'] ) ) + if ( ! empty( $args['hierarchical'] ) ) { $pad = str_repeat(' ', $depth * 3); - else + } else { $pad = ''; + } $cat_name = apply_filters( 'list_product_cats', $cat->name, $cat ); + $value = isset( $args['value'] ) && $args['value'] == 'id' ? $cat->term_id : $cat->slug; + $output .= "\t\n"; } From 35c499aa8134630e122d22e18cc69069b68425cc Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 29 Jul 2016 18:46:39 -0300 Subject: [PATCH 2/2] Fixed product archive on front #11500 --- includes/class-wc-query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-query.php b/includes/class-wc-query.php index 54f98bb218b..17b0b60e9dd 100644 --- a/includes/class-wc-query.php +++ b/includes/class-wc-query.php @@ -275,7 +275,7 @@ class WC_Query { } // Special check for shops with the product archive on front - if ( $this->is_showing_page_on_front( $q ) && absint( $q->get( 'page_id' ) ) === wc_get_page_id( 'shop' ) ) { + if ( $q->is_page() && 'page' === get_option( 'show_on_front' ) && absint( $q->get( 'page_id' ) ) === wc_get_page_id( 'shop' ) ) { // This is a front-page shop $q->set( 'post_type', 'product' ); $q->set( 'page_id', '' );