From 82ed7846b2340b03b1c01ab1b44fbbcaa82fff68 Mon Sep 17 00:00:00 2001 From: Steven Dufresne Date: Mon, 25 Nov 2024 13:21:29 +0900 Subject: [PATCH] Show a more accurate star rating. (#670) Co-authored-by: Kelly Dwan --- mu-plugins/blocks/ratings-stars/render.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/mu-plugins/blocks/ratings-stars/render.php b/mu-plugins/blocks/ratings-stars/render.php index fbc98a4c..c72bff10 100644 --- a/mu-plugins/blocks/ratings-stars/render.php +++ b/mu-plugins/blocks/ratings-stars/render.php @@ -29,12 +29,11 @@
'; - } else if ( $i + 0.5 === $display_rating ) { + } else if ( $i + 0.5 <= $rounded_rating ) { echo ''; } else { echo ''; @@ -45,10 +44,15 @@
' . $display_rating . '' // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + '' . esc_html( $display_rating_str ) . '' ); ?>