Changeset 2679
- Timestamp:
- 03/03/2016 07:03:43 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
r2540 r2679 127 127 } 128 128 add_filter( 'body_class', 'wporg_themes_body_class' ); 129 130 /**131 * Prevent the default posts queries running, allowing pages to bypass132 * We do this as the themes are pulled from an API.133 */134 function wporg_themes_prevent_posts_query( $query, $wp_query ) {135 if ( is_admin() || ! $wp_query->is_main_query() || $wp_query->get( 'pagename' ) ) {136 return $query;137 }138 $wp_query->set( 'no_found_rows', true );139 return ''; // Don't make a query140 }141 add_filter( 'posts_request', 'wporg_themes_prevent_posts_query', 10, 2 );142 129 143 130 /**
Note: See TracChangeset
for help on using the changeset viewer.