Making WordPress.org

Ticket #1805: 1805.comment.count.1.diff

File 1805.comment.count.1.diff, 2.4 KB (added by dufresnesteven, 5 years ago)

Thanks @dd32. Using _bbp_reply_count to get the count instead.

  • wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php
    index 049a66d92..d3d2f8eeb 100644
    class Reviews { 
    3939                        foreach ( $reviews as $review ) {
    4040                                $GLOBALS['post'] = $review; // Override the_post();
    4141                                setup_postdata( $review );
     42                                $reply_count = (int)get_post_meta( $review->ID, '_bbp_reply_count', true ) ;
     43
    4244                                ?>
    4345                                <article class="plugin-review">
    4446                                        <div class="review-avatar">
    class Reviews { 
    4749                                                <header>
    4850                                                        <div class="header-top">
    4951                                                                <?php echo Template::dashicons_stars( $review->post_rating ); ?>
    50                                                                 <h3 class="review-title"><a class="url" href="<?php echo esc_url( 'https://wordpress.org/support/topic/' . $review->post_name . '/' ); ?>"><?php echo get_the_title( $review ); ?></a></h3>
     52                                                                <h3 class="review-title">
     53                                                                        <a class="url" href="<?php echo esc_url( 'https://wordpress.org/support/topic/' . $review->post_name . '/' ); ?>"><?php echo get_the_title( $review ); ?></a>
     54                                                                        <span class="review-title-comments">
     55                                                                                <?php printf( _n( '%s Comment', '%s Comments', $reply_count, 'wporg-plugins' ), number_format_i18n( $reply_count ) ); ?>
     56                                                                        </span>
     57                                                                </h3>
    5158                                                        </div>
    5259                                                        <div class="header-bottom">
    5360                                                                <span class="review-author author vcard"><?php the_author_posts_link(); ?></span>
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/reviews/style.scss

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/reviews/style.scss wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/client/components/plugin/sections/reviews/style.scss
    index 6244018a5..a76a7ad21 100644
     
    4949                line-height: 1.25;
    5050        }
    5151
     52        .review-title-comments {
     53                padding-left: 8px;
     54                font-size: 13px;
     55                font-weight: normal;
     56                font-style: italic;
     57                color: #666;
     58        }
     59
    5260        .review-author,
    5361        .review-date {
    5462                line-height: 1.25;