Making WordPress.org

Changeset 4388


Ignore:
Timestamp:
11/21/2016 03:53:28 AM (8 years ago)
Author:
tellyworth
Message:

Plugin directory: make featured reviews clickable.

Fixes #2247

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

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

    r4311 r4388  
    5555            $reviews = $wpdb->get_results( $wpdb->prepare(
    5656            "SELECT
    57                     post_content, post_title, post_author, post_modified,
     57                    ID, post_content, post_title, post_author, post_modified,
    5858                    r.rating as post_rating
    5959            FROM ratings r
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php

    r4223 r4388  
    2626        <div class="plugin-reviews">
    2727            <?php
    28             foreach ( $reviews as $review ) :
     28        foreach ( $reviews as $review ) :
    2929                $reviewer = get_user_by( 'id', $review->post_author );
    3030                if ( ! $reviewer ) :
     
    3737                    </div><div class="review">
    3838                        <header>
    39                             <h3 class="review-title"><?php echo $review->post_title; ?></h3>
     39                            <?php if ( !empty( $review->ID ) ) : ?>
     40                                <h3 class="review-title"><a class="url" href="<?php echo esc_url( add_query_arg( array( 'p' => $review->ID ), 'https://wordpress.org/support/plugin/' ) ); ?>"><?php echo $review->post_title; ?></a></h3>
     41                            <?php else: ?>
     42                                <h3 class="review-title"><?php echo $review->post_title; ?></h3>
     43                            <?php endif; ?>
    4044                            <?php echo Template::dashicons_stars( $review->post_rating ); ?>
    4145                            <span class="review-author author vcard"><a class="url fn n" href="<?php echo esc_url( get_author_posts_url( $reviewer->ID ) ); ?>"><?php echo Template::encode( $reviewer->display_name ); ?></a></span>
Note: See TracChangeset for help on using the changeset viewer.