From d98962712571592323cebf11a72b6ec6e39b49e3 Mon Sep 17 00:00:00 2001
From: Claudio Sanches
'; // 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 ) { ?>