From bc83a04c6ca99416774f97c12d932d3e3d240a31 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 11 Feb 2016 11:13:48 +0000 Subject: [PATCH] Feedback from Justin --- .../settings/class-wc-settings-checkout.php | 2 +- .../settings/class-wc-settings-products.php | 12 +++++------ includes/class-wc-query.php | 21 ++++++++++--------- .../widgets/class-wc-widget-rating-filter.php | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/includes/admin/settings/class-wc-settings-checkout.php b/includes/admin/settings/class-wc-settings-checkout.php index 1570cc46ad5..77a759610b5 100644 --- a/includes/admin/settings/class-wc-settings-checkout.php +++ b/includes/admin/settings/class-wc-settings-checkout.php @@ -78,7 +78,7 @@ class WC_Settings_Payment_Gateways extends WC_Settings_Page { 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', - 'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'woocommerce' ) + 'desc_tip' => __( 'Coupons can be applied from the cart and checkout pages.', 'woocommerce' ), ), array( diff --git a/includes/admin/settings/class-wc-settings-products.php b/includes/admin/settings/class-wc-settings-products.php index 62e1597b191..1afd3f002e1 100644 --- a/includes/admin/settings/class-wc-settings-products.php +++ b/includes/admin/settings/class-wc-settings-products.php @@ -455,14 +455,14 @@ class WC_Settings_Products extends WC_Settings_Page { array( 'type' => 'sectionend', - 'id' => 'product_measurement_options' + 'id' => 'product_measurement_options', ), array( 'title' => __( 'Reviews', 'woocommerce' ), 'type' => 'title', 'desc' => '', - 'id' => 'product_rating_options' + 'id' => 'product_rating_options', ), array( @@ -472,7 +472,7 @@ class WC_Settings_Products extends WC_Settings_Page { 'default' => 'yes', 'type' => 'checkbox', 'checkboxgroup' => 'start', - 'show_if_checked' => 'option' + 'show_if_checked' => 'option', ), array( @@ -482,7 +482,7 @@ class WC_Settings_Products extends WC_Settings_Page { 'type' => 'checkbox', 'checkboxgroup' => '', 'show_if_checked' => 'yes', - 'autoload' => false + 'autoload' => false, ), array( @@ -492,7 +492,7 @@ class WC_Settings_Products extends WC_Settings_Page { 'type' => 'checkbox', 'checkboxgroup' => '', 'show_if_checked' => 'yes', - 'autoload' => false + 'autoload' => false, ), array( @@ -502,7 +502,7 @@ class WC_Settings_Products extends WC_Settings_Page { 'type' => 'checkbox', 'checkboxgroup' => 'end', 'show_if_checked' => 'yes', - 'autoload' => false + 'autoload' => false, ), array( diff --git a/includes/class-wc-query.php b/includes/class-wc-query.php index c9c7c4965a3..c57f96fc599 100644 --- a/includes/class-wc-query.php +++ b/includes/class-wc-query.php @@ -37,7 +37,6 @@ class WC_Query { public function __construct() { add_action( 'init', array( $this, 'add_endpoints' ) ); if ( ! is_admin() ) { - add_action( 'init', array( $this, 'layered_nav_init' ) ); add_action( 'wp_loaded', array( $this, 'get_errors' ), 20 ); add_filter( 'query_vars', array( $this, 'add_query_vars'), 0 ); add_action( 'parse_request', array( $this, 'parse_request'), 0 ); @@ -498,8 +497,8 @@ class WC_Query { */ private function price_filter_meta_query() { if ( isset( $_GET['max_price'] ) || isset( $_GET['min_price'] ) ) { - $min = isset( $_GET['min_price'] ) ? floatval( $_GET['min_price'] ) : 0; - $max = isset( $_GET['max_price'] ) ? floatval( $_GET['max_price'] ) : 9999999999; + $min = isset( $_GET['min_price'] ) ? floatval( $_GET['min_price'] ) : 0; + $max = isset( $_GET['max_price'] ) ? floatval( $_GET['max_price'] ) : 9999999999; // If displaying prices in the shop including taxes, but prices don't include taxes.. if ( wc_tax_enabled() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) && ! wc_prices_include_tax() ) { @@ -523,7 +522,7 @@ class WC_Query { 'value' => array( $min, $max ), 'compare' => 'BETWEEN', 'type' => 'DECIMAL', - 'price_filter' => true + 'price_filter' => true, ); } return array(); @@ -539,7 +538,7 @@ class WC_Query { 'value' => isset( $_GET['min_rating'] ) ? floatval( $_GET['min_rating'] ) : 0, 'compare' => '>=', 'type' => 'DECIMAL', - 'rating_filter' => true + 'rating_filter' => true, ) : array(); } @@ -552,7 +551,7 @@ class WC_Query { return array( 'key' => '_visibility', 'value' => is_search() ? array( 'visible', 'search' ) : array( 'visible', 'catalog' ), - 'compare' => $compare + 'compare' => $compare, ); } @@ -567,7 +566,7 @@ class WC_Query { return 'yes' === get_option( 'woocommerce_hide_out_of_stock_items' ) ? array( 'key' => '_stock_status', 'value' => $status, - 'compare' => '=' + 'compare' => '=', ) : array(); } @@ -589,7 +588,7 @@ class WC_Query { 'field' => 'slug', 'terms' => $data['terms'], 'operator' => 'and' === $data['query_type'] ? 'AND' : 'IN', - 'include_children' => false + 'include_children' => false, ); } } @@ -611,7 +610,7 @@ class WC_Query { $tax_query[] = array( 'taxonomy' => $args['taxonomy'], 'terms' => array( $args['term'] ), - 'field' => 'slug' + 'field' => 'slug', ); } @@ -660,7 +659,9 @@ class WC_Query { /** * @deprecated 2.6.0 */ - public function layered_nav_init() {} + public function layered_nav_init() { + _deprecated_function( 'layered_nav_init', '2.6', '' ); + } /** * Get an unpaginated list all product ID's (both filtered and unfiltered). Makes use of transients. diff --git a/includes/widgets/class-wc-widget-rating-filter.php b/includes/widgets/class-wc-widget-rating-filter.php index 5c8f341012a..f66bb0f63a4 100644 --- a/includes/widgets/class-wc-widget-rating-filter.php +++ b/includes/widgets/class-wc-widget-rating-filter.php @@ -172,7 +172,7 @@ class WC_Widget_Rating_Filter extends WC_Widget { echo ' ' . sprintf( __( 'Rated %s and above', 'woocommerce'), $rating ) . ' - (' . $count . ')'; + (' . esc_html( $count ) . ')'; echo '';