Making WordPress.org


Ignore:
Timestamp:
06/18/2016 03:07:08 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Consolidate review queries.

See #1719, #1579.

File:
1 edited

Legend:

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

    r3427 r3439  
    1515     */
    1616    static function display() {
    17         $reviews = Tools::get_plugin_reviews( get_post()->post_name );
     17        $reviews = Tools::get_plugin_reviews( get_post()->post_name, array(
     18            'number' => 2,
     19        ) );
    1820
    1921        if ( empty( $reviews ) ) {
     
    2729            <?php
    2830            foreach ( $reviews as $review ) :
    29                 $reviewer = get_user_by( 'id', $review->post_author );
     31                $reviewer = get_user_by( 'id', $review->topic_poster );
    3032                if ( ! $reviewer ) :
    3133                    continue;
     
    3739                    </div><div class="review">
    3840                        <header>
    39                             <h3 class="review-title"><?php echo $review->post_title; ?></h3>
    40                             <?php echo Template::dashicons_stars( $review->post_rating ); ?>
    41                             <span class="review-author author vcard"><a class="url fn n" href="<?php esc_url( get_author_posts_url( $reviewer->ID ) ); ?>"><?php echo Template::encode( $reviewer->display_name ); ?></a></span>
     41                            <h3 class="review-title"><?php echo $review->topic_title; ?></h3>
     42                            <?php echo Template::dashicons_stars( $review->rating ); ?>
     43                            <span class="review-author author vcard"><a class="url fn n" href="<?php esc_url( 'https://profile.wordpress.org/' . $reviewer->user_nicename . '/' ); ?>"><?php echo Template::encode( $reviewer->display_name ); ?></a></span>
    4244                        </header>
    43                         <p class="review-content"><?php echo $review->post_content; ?></p>
     45                        <p class="review-content"><?php echo $review->post_text; ?></p>
    4446                    </div>
    4547                </article>
Note: See TracChangeset for help on using the changeset viewer.