WordPress.org

Making WordPress.org


Ignore:
Timestamp:
03/18/2019 02:49:56 AM (12 months ago)
Author:
dd32
Message:

Plugin Directory: Link directly to the Reviews rather than using the ?p= syntax.

Fixes #4286.

File:
1 edited

Legend:

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

    r8075 r8474  
    3131            foreach ( $reviews as $review ) :
    3232                setup_postdata( $review );
     33                if ( !empty( $review->post_name ) ) {
     34                    $url = 'https://wordpress.org/support/topic/' . $review->post_name . '/';
     35                } else {
     36                    $url = add_query_arg( array( 'p' => $review->ID ), 'https://wordpress.org/support/plugin/' );
     37                }
    3338                ?>
    3439                <article class="plugin-review">
     
    3742                    </div><div class="review">
    3843                        <header>
    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 get_the_title( $review ); ?></a></h3>
    41                             <?php else : ?>
    42                                 <h3 class="review-title"><?php echo get_the_title( $review ); ?></h3>
    43                             <?php endif; ?>
     44                            <h3 class="review-title"><a class="url" href="<?php echo esc_url( $url ); ?>"><?php echo get_the_title( $review ); ?></a></h3>
    4445                            <?php echo Template::dashicons_stars( $review->post_rating ); ?>
    4546                            <span class="review-author author vcard"><?php the_author_posts_link(); ?></span>
Note: See TracChangeset for help on using the changeset viewer.