Making WordPress.org

Changeset 12250


Ignore:
Timestamp:
11/17/2022 11:57:53 PM (2 years ago)
Author:
coffee2code
Message:

Plugin Directory: Output number of replies (if non-zero) for each review on the reviews tab.

Props hlashbrooke, dufresnesteven, coffee2code.
See #1805, #6418.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php

    r10000 r12250  
    4040                $GLOBALS['post'] = $review; // Override the_post();
    4141                setup_postdata( $review );
     42                $reply_count = (int) get_post_meta( $review->ID, '_bbp_reply_count', true );
    4243                ?>
    4344                <article class="plugin-review">
     
    5354                                <span class="review-author author vcard"><?php the_author_posts_link(); ?></span>
    5455                                <span class="review-date"><?php echo date_i18n( get_option( 'date_format' ), strtotime( $review->post_modified ) ); ?></span>
     56                                <?php if ( $reply_count ) : ?>
     57                                <span class="review-replies"><?php printf( _n( '%s reply', '%s replies', $reply_count, 'wporg-plugins' ), number_format_i18n( $reply_count ) ); ?></span>
     58                                <?php endif; ?>
    5559                            </div>
    5660                        </header>
Note: See TracChangeset for help on using the changeset viewer.