Changeset 7918 for trunk/bp-blogs/bp-blogs-template.php
- Timestamp:
- 02/18/2014 12:50:11 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-template.php
r7828 r7918 170 170 * @param string $page_arg The string used as a query parameter in 171 171 * pagination links. Default: 'bpage'. 172 */ 173 function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage' ) { 172 * @param bool $update_meta_cache Whether to pre-fetch metadata for 173 * queried blogs. 174 */ 175 function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage', $update_meta_cache = true ) { 174 176 175 177 $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; … … 179 181 $this->blogs = BP_Blogs_Blog::get_by_letter( $_REQUEST['letter'], $this->pag_num, $this->pag_page ); 180 182 else 181 $this->blogs = bp_blogs_get_blogs( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms ) );183 $this->blogs = bp_blogs_get_blogs( array( 'type' => $type, 'per_page' => $this->pag_num, 'page' => $this->pag_page, 'user_id' => $user_id, 'search_terms' => $search_terms, 'update_meta_cache' => $update_meta_cache, ) ); 182 184 183 185 if ( !$max || $max >= (int) $this->blogs['total'] ) … … 360 362 361 363 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 362 'search_terms' => $search_terms // Pass search terms to filter on the blog title or description. 364 'search_terms' => $search_terms, // Pass search terms to filter on the blog title or description. 365 'update_meta_cache' => true, 363 366 ); 364 367 … … 379 382 } 380 383 381 $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg );384 $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg, $update_meta_cache ); 382 385 return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template ); 383 386 }
Note: See TracChangeset
for help on using the changeset viewer.