Changeset 5891 for trunk/bp-blogs/bp-blogs-template.php
- Timestamp:
- 03/06/2012 07:15:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-template.php
r5729 r5891 103 103 var $total_blog_count; 104 104 105 function bp_blogs_template( $type, $page, $per_page, $max, $user_id, $search_terms ) { 106 $this->__construct( $type, $page, $per_page, $max, $user_id, $search_terms ); 107 } 108 109 function __construct( $type, $page, $per_page, $max, $user_id, $search_terms ) { 110 111 $this->pag_page = isset( $_REQUEST['bpage'] ) ? intval( $_REQUEST['bpage'] ) : $page; 105 function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage' ) { 106 107 $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; 112 108 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 113 109 … … 136 132 if ( (int) $this->total_blog_count && (int) $this->pag_num ) { 137 133 $this->pag_links = paginate_links( array( 138 'base' => add_query_arg( 'bpage', '%#%' ),134 'base' => add_query_arg( $page_arg, '%#%' ), 139 135 'format' => '', 140 136 'total' => ceil( (int) $this->total_blog_count / (int) $this->pag_num ), … … 209 205 $search_terms = null; 210 206 211 / * User filtering */207 // User filtering 212 208 if ( bp_displayed_user_id() ) 213 209 $user_id = bp_displayed_user_id(); … … 219 215 'max' => false, 220 216 221 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 222 'search_terms' => $search_terms // Pass search terms to filter on the blog title or description. 217 'page_arg' => 'bpage', // See https://buddypress.trac.wordpress.org/ticket/3679 218 219 'user_id' => $user_id, // Pass a user_id to limit to only blogs this user has higher than subscriber access to 220 'search_terms' => $search_terms // Pass search terms to filter on the blog title or description. 223 221 ); 224 222 … … 239 237 } 240 238 241 $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms );239 $blogs_template = new BP_Blogs_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg ); 242 240 return apply_filters( 'bp_has_blogs', $blogs_template->has_blogs(), $blogs_template ); 243 241 } … … 280 278 function bp_get_blog_avatar( $args = '' ) { 281 279 global $blogs_template; 282 280 283 281 $defaults = array( 284 282 'type' => 'full', … … 528 526 function bp_blogs_get_subdomain_base() { 529 527 global $current_site; 530 528 531 529 return apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path ); 532 530 }
Note: See TracChangeset
for help on using the changeset viewer.