Changeset 9016 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php
- Timestamp:
- 07/02/2019 05:49:32 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-reviews.php
r8917 r9016 29 29 <div class="plugin-reviews"> 30 30 <?php 31 foreach ( $reviews as $review ) : 31 // Switch to the Support Forum so that Template functions that call get_post() work as intended. 32 if ( defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) { 33 switch_to_blog( WPORG_SUPPORT_FORUMS_BLOGID ); 34 } 35 36 foreach ( $reviews as $review ) { 37 $GLOBALS['post'] = $review; // Override the_post(); 32 38 setup_postdata( $review ); 33 39 ?> … … 44 50 </div> 45 51 </article> 46 <?php endforeach; ?> 52 <?php 53 } 54 55 // Reset back to the plugin post. 56 wp_reset_postdata(); 57 if ( defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) { 58 restore_current_blog(); 59 } 60 ?> 47 61 </div> 48 <?php wp_reset_postdata(); ?>49 62 50 63 <a class="reviews-link" href="<?php echo esc_url( 'https://wordpress.org/support/plugin/' . get_post()->post_name . '/reviews/' ); ?>">
Note: See TracChangeset
for help on using the changeset viewer.