Ticket #3679: 3679.01.patch
File 3679.01.patch, 3.1 KB (added by , 13 years ago) |
---|
-
bp-members/bp-members-template.php
class BP_Core_Members_Template { 168 168 var $pag_links; 169 169 var $total_member_count; 170 170 171 function bp_core_members_template( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {172 $this->__construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value );171 function bp_core_members_template( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg ) { 172 $this->__construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg ); 173 173 } 174 174 175 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {175 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg ) { 176 176 global $bp; 177 177 178 $this->pag_page = !empty( $_REQUEST[ 'upage'] ) ? intval( $_REQUEST['upage'] ) : (int)$page_number;178 $this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int)$page_number; 179 179 $this->pag_num = !empty( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : (int)$per_page; 180 180 $this->type = $type; 181 181 … … class BP_Core_Members_Template { 205 205 206 206 if ( (int)$this->total_member_count && (int)$this->pag_num ) { 207 207 $this->pag_links = paginate_links( array( 208 'base' => add_query_arg( 'upage', '%#%' ),208 'base' => add_query_arg( $page_arg, '%#%' ), 209 209 'format' => '', 210 210 'total' => ceil( (int)$this->total_member_count / (int)$this->pag_num ), 211 211 'current' => (int) $this->pag_page, … … function bp_has_members( $args = '' ) { 290 290 'page' => $page, 291 291 'per_page' => 20, 292 292 'max' => false, 293 'page_arg' => 'upage', 293 294 294 295 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users 295 296 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users … … function bp_has_members( $args = '' ) { 322 323 if ( empty( $include ) && bp_is_friends_component() && bp_is_current_action( 'requests' ) ) 323 324 return false; 324 325 325 $members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value );326 $members_template = new BP_Core_Members_Template( $type, $page, $per_page, $max, $user_id, $search_terms, $include, (bool)$populate_extras, $exclude, $meta_key, $meta_value, $page_arg ); 326 327 return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template ); 327 328 }