Changeset 3420
- Timestamp:
- 06/17/2016 08:27:41 PM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php
r3409 r3420 247 247 add_shortcode( 'wporg-plugin-upload', array( __NAMESPACE__ . '\Shortcodes\Upload', 'display' ) ); 248 248 add_shortcode( 'wporg-plugins-screenshots', array( __NAMESPACE__ . '\Shortcodes\Screenshots', 'display' ) ); 249 add_shortcode( 'wporg-plugins-reviews', array( __NAMESPACE__ . '\Shortcodes\Reviews', 'display' ) ); 249 250 } 250 251 … … 676 677 'screenshots' => '[wporg-plugins-screenshots]', 677 678 'developers' => '[wporg-plugins-developers]', 679 'reviews' => '[wporg-plugins-reviews]', 678 680 ); 679 681 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php
r2836 r3420 27 27 28 28 return $tonesque->color(); 29 } 30 31 /** 32 * Returns the two latest reviews of a specific plugin. 33 * 34 * @global \wpdb $wpdb WordPress database abstraction object. 35 * 36 * @todo Populate with review title/content. 37 * 38 * @param string $plugin_slug The plugin slug. 39 * @return array|false 40 */ 41 public static function get_plugin_reviews( $plugin_slug ) { 42 if ( false === ( $reviews = wp_cache_get( "{$plugin_slug}_reviews", 'wporg-plugins' ) ) ) { 43 global $wpdb; 44 45 $reviews = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM ratings WHERE object_type = 'plugin' AND object_slug = %s ORDER BY review_id DESC LIMIT 2", $plugin_slug ) ); 46 wp_cache_set( "{$plugin_slug}_reviews", $reviews, 'wporg-plugins', HOUR_IN_SECONDS ); 47 } 48 49 return $reviews; 29 50 } 30 51 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
r3412 r3420 45 45 <?php 46 46 $plugin_sections = Template::get_plugin_sections(); 47 47 48 foreach ( array( 'description', 'screenshots', 'faq', 'reviews', 'changelog', 'developers' ) as $section_slug ) : 48 if ( ! array_key_exists( $section_slug, $content ) || in_array( $section_slug, array( 'installation', 'other_notes' ) ) ) : 49 $section_content = trim( apply_filters( 'the_content', $content[ $section_slug ], $section_slug ) ); 50 51 if ( ! array_key_exists( $section_slug, $content ) || in_array( $section_slug, array( 'installation', 'other_notes' ) ) || empty( $section_content ) ) : 49 52 continue; 50 53 endif; 54 51 55 $section = wp_list_filter( $plugin_sections, array( 'slug' => $section_slug ) ); 52 56 $section = array_pop( $section ); … … 55 59 <div id="<?php echo esc_attr( $section_slug ); ?>" class="read-more" aria-expanded="false"> 56 60 <h2><?php echo $section['title']; ?></h2> 57 <?php echo apply_filters( 'the_content', $content[ $section_slug ], $section_slug ); ?>61 <?php echo $section_content; ?> 58 62 </div> 59 63 <button type="button" class="button-link section-toggle" aria-controls="<?php echo esc_attr( $section_slug ); ?>"><?php _e( 'Read more', 'wporg-plugins' ); ?></button>
Note: See TracChangeset
for help on using the changeset viewer.