Changeset 5891 for trunk/bp-groups/bp-groups-template.php
- Timestamp:
- 03/06/2012 07:15:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r5758 r5891 108 108 var $order; 109 109 110 function bp_groups_template( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ) { 111 $this->__construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $include, $populate_extras, $exclude, $show_hidden ); 112 } 113 114 function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false ){ 115 116 $this->pag_page = isset( $_REQUEST['grpage'] ) ? intval( $_REQUEST['grpage'] ) : $page; 110 function __construct( $user_id, $type, $page, $per_page, $max, $slug, $search_terms, $populate_extras, $include = false, $exclude = false, $show_hidden = false, $page_arg = 'grpage' ){ 111 112 $this->pag_page = isset( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : $page; 117 113 $this->pag_num = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page; 118 114 … … 171 167 if ( (int) $this->total_group_count && (int) $this->pag_num ) { 172 168 $this->pag_links = paginate_links( array( 173 'base' => add_query_arg( array( 'grpage'=> '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ),169 'base' => add_query_arg( array( $page_arg => '%#%', 'num' => $this->pag_num, 's' => $search_terms, 'sortby' => $this->sort_by, 'order' => $this->order ) ), 174 170 'format' => '', 175 171 'total' => ceil( (int) $this->total_group_count / (int) $this->pag_num ), … … 266 262 'show_hidden' => false, 267 263 264 'page_arg' => 'grpage', // See https://buddypress.trac.wordpress.org/ticket/3679 265 268 266 'user_id' => $user_id, // Pass a user ID to limit to groups this user has joined 269 267 'slug' => $slug, // Pass a group slug to only return that group … … 287 285 } 288 286 289 $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden );287 $groups_template = new BP_Groups_Template( (int) $user_id, $type, (int) $page, (int) $per_page, (int) $max, $slug, $search_terms, (bool)$populate_extras, $include, $exclude, $show_hidden, $page_arg ); 290 288 return apply_filters( 'bp_has_groups', $groups_template->has_groups(), $groups_template ); 291 289 }
Note: See TracChangeset
for help on using the changeset viewer.