From d3b81b17a8bcdad055fb62bf9e745b582b48a72b Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 9 Mar 2018 17:45:45 -0300 Subject: [PATCH] Fixed class-wc-widget-recent-reviews.php PHPCS violations --- .../class-wc-widget-recent-reviews.php | 43 +++++++++++-------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/includes/widgets/class-wc-widget-recent-reviews.php b/includes/widgets/class-wc-widget-recent-reviews.php index a049c9ff331..da6fef7fd4d 100644 --- a/includes/widgets/class-wc-widget-recent-reviews.php +++ b/includes/widgets/class-wc-widget-recent-reviews.php @@ -1,17 +1,15 @@ get_cached_widget( $args ) ) { @@ -60,7 +57,15 @@ class WC_Widget_Recent_Reviews extends WC_Widget { ob_start(); $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : $this->settings['number']['std']; - $comments = get_comments( array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product', 'parent' => 0 ) ); + $comments = get_comments( + array( + 'number' => $number, + 'status' => 'approve', + 'post_status' => 'publish', + 'post_type' => 'product', + 'parent' => 0, + ) + ); // WPCS: override ok. if ( $comments ) { $this->widget_start( $args, $instance ); @@ -77,12 +82,12 @@ class WC_Widget_Recent_Reviews extends WC_Widget { echo '
  • '; - echo $_product->get_image() . wp_kses_post( $_product->get_name() ) . ''; + echo $_product->get_image() . wp_kses_post( $_product->get_name() ) . ''; // WPCS: XSS ok. - echo $rating_html; + echo $rating_html; // WPCS: XSS ok. /* translators: %s: review author */ - echo '' . sprintf( esc_html__( 'by %s', 'woocommerce' ), get_comment_author() ) . ''; + echo '' . sprintf( esc_html__( 'by %s', 'woocommerce' ), get_comment_author() ) . ''; // WPCS: XSS ok. echo '
  • '; } @@ -94,7 +99,7 @@ class WC_Widget_Recent_Reviews extends WC_Widget { $content = ob_get_clean(); - echo $content; + echo $content; // WPCS: XSS ok. $this->cache_widget( $args, $content ); }