Skip to content

Commit

Permalink
Update stars logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne committed Jun 24, 2024
1 parent 798faba commit a0f3048
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mu-plugins/blocks/ratings-bars/render.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<ul <?php echo get_block_wrapper_attributes(); // phpcs:ignore ?>>
<?php
foreach ( range( 5, 1 ) as $stars ) :
if ( ! isset( $attributes['ratings'][ $stars - 1 ] ) ) {
if ( ! isset( $attributes['ratings'][ $stars ] ) ) {
continue;
}
$count = $attributes['ratings'][ $stars - 1 ];
$count = $attributes['ratings'][ $stars ];
$rating_bar_width = 100 * $count / $attributes['num_ratings'];
?>
<li class="wporg-ratings-bars__bar">
Expand Down

0 comments on commit a0f3048

Please sign in to comment.