From 8ff64c30881d0fd70c63fe9ff6287a4a896298a0 Mon Sep 17 00:00:00 2001 From: Steve Dufresne Date: Wed, 13 Nov 2024 05:02:50 +0000 Subject: [PATCH] support-forums: Replace ratings bars/stars with shared component. See: https://github.com/WordPress/wordpress.org/pull/408 git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14173 74240141-8908-4e6f-9713-ba540dce6ec7 --- .../inc/class-ratings-compat.php | 71 ++++--------------- 1 file changed, 13 insertions(+), 58 deletions(-) diff --git a/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php b/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php index 6ae00461f1..434f27a623 100644 --- a/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php +++ b/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php @@ -212,65 +212,9 @@ public function do_view_header() { add_filter( 'bbp_get_topic_last_topic_title', array( $this, 'undo_topic_title' ), 10, 1 ); ?>
-
- -
reviews_count, 'wporg-forums' ), - '' . number_format_i18n( $this->reviews_count ) . '' - ); - ?>
- ratings_counts[ $rating ] ) ? $this->ratings_counts[ $rating ] : 0; - $ratings_count_total = isset( $this->ratings_counts ) ? array_sum( $this->ratings_counts) : 0; - $stars_title = sprintf( - /* translators: %s: number of stars */ - _n( - 'Click to see reviews that provided a rating of %d star', - 'Click to see reviews that provided a rating of %d stars', - $rating, - 'wporg-forums' - ), - $rating - ); - /* translators: %d: number of stars */ - $stars_text = sprintf( - /* translators: %d: number of stars */ - _n( '%d star', '%d stars', $rating, 'wporg-forums' ), - $rating - ); - $width = 0; - if ( $ratings_count && $ratings_count_total ) { - $width = 100 * ( $ratings_count / $ratings_count_total ); - } - ?> - - -
-
+
- avg_rating ); - printf( - /* translators: 1: number of stars in rating, 2: total number of stars (5) */ - __( '%1$s out of %2$s stars', 'wporg-forums' ), - round( isset( $this->avg_rating ) ? $this->avg_rating : 0, 1 ), - '5' - ); - ?> + ' ); ?>
+
+ +
reviews_count, 'wporg-forums' ), + '' . number_format_i18n( $this->reviews_count ) . '' + ); + ?>
+ ' ); ?> +