Changeset 3218
- Timestamp:
- 05/23/2016 03:47:14 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/front-page.php
r3208 r3218 27 27 28 28 <?php foreach ( $sections as $section_slug => $section_title ) : 29 $section_args = array( 30 'post_type' => 'plugin', 31 'posts_per_page' => 4, 32 'plugin_category' => $section_slug, 33 ); 29 if ( false === ( $section_query = wp_cache_get( "{$section_slug}:front_page", 'wporg-plugins' ) ) ) : 30 $section_args = array( 31 'post_type' => 'plugin', 32 'posts_per_page' => 4, 33 'plugin_category' => $section_slug, 34 ); 34 35 35 if ( 'popular' === $section_slug ) : 36 $section_args['meta_key'] = 'active_installs'; 37 $section_args['orderby'] = 'meta_value_num'; 38 unset( $section_args['plugin_category'] ); 36 if ( 'popular' === $section_slug ) : 37 $section_args['meta_key'] = 'active_installs'; 38 $section_args['orderby'] = 'meta_value_num'; 39 unset( $section_args['plugin_category'] ); 40 endif; 41 42 $section_query = new \WP_Query( $section_args ); 43 wp_cache_set( "{$section_slug}:front_page", $section_query, 'wporg-plugins', DAY_IN_SECONDS ); 39 44 endif; 40 41 $section_query = new \WP_Query( $section_args );42 45 ?> 43 46
Note: See TracChangeset
for help on using the changeset viewer.