From d98962712571592323cebf11a72b6ec6e39b49e3 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Wed, 21 Mar 2018 00:02:57 -0300 Subject: [PATCH] Fixed includes/class-wc-embed.php PHPCS violations --- includes/class-wc-embed.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/class-wc-embed.php b/includes/class-wc-embed.php index d16d893668f..296e89c7040 100644 --- a/includes/class-wc-embed.php +++ b/includes/class-wc-embed.php @@ -1,11 +1,9 @@ ' . $_product->get_price_html() . '

'; + echo '

' . $_product->get_price_html() . '

'; // WPCS: XSS ok. if ( ! empty( $post->post_excerpt ) ) { ob_start(); @@ -121,12 +115,18 @@ class WC_Embed { */ public static function get_ratings() { // Make sure we're only affecting embedded products. - if ( self::is_embedded_product() && ( $_product = wc_get_product( get_the_ID() ) ) && $_product->get_average_rating() > 0 ) { + if ( ! self::is_embedded_product() ) { + return; + } + + $_product = wc_get_product( get_the_ID() ); + + if ( $_product && $_product->get_average_rating() > 0 ) { ?>
get_average_rating() ) );