Ticket #3679: 3679.members.01.diff
File 3679.members.01.diff, 2.8 KB (added by , 13 years ago) |
---|
-
bp-members/bp-members-template.php
169 169 var $pag_links; 170 170 var $total_member_count; 171 171 172 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value ) {172 function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude, $meta_key, $meta_value, $page_arg = 'upage' ) { 173 173 174 $this->pag_page = !empty( $_REQUEST[ 'upage'] ) ? intval( $_REQUEST['upage'] ) : (int) $page_number;174 $this->pag_page = !empty( $_REQUEST[$page_arg] ) ? intval( $_REQUEST[$page_arg] ) : (int) $page_number; 175 175 $this->pag_num = !empty( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : (int) $per_page; 176 176 $this->type = $type; 177 177 … … 199 199 200 200 if ( (int) $this->total_member_count && (int) $this->pag_num ) { 201 201 $this->pag_links = paginate_links( array( 202 'base' => add_query_arg( 'upage', '%#%' ),202 'base' => add_query_arg( $page_arg, '%#%' ), 203 203 'format' => '', 204 204 'total' => ceil( (int) $this->total_member_count / (int) $this->pag_num ), 205 205 'current' => (int) $this->pag_page, … … 285 285 'per_page' => 20, 286 286 'max' => false, 287 287 288 'page_arg' => 'upage', // See https://buddypress.trac.wordpress.org/ticket/3679 289 288 290 'include' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to only show these users 289 291 'exclude' => false, // Pass a user_id or a list (comma-separated or array) of user_ids to exclude these users 290 292 … … 316 318 if ( empty( $include ) && bp_is_friends_component() && bp_is_current_action( 'requests' ) ) 317 319 return false; 318 320 319 $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 );321 $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 ); 320 322 return apply_filters( 'bp_has_members', $members_template->has_members(), $members_template ); 321 323 } 322 324 … … 866 868 function bp_user_link() { bp_displayed_user_domain(); } // Deprecated. 867 869 868 870 function bp_displayed_user_id() { 869 871 870 872 static $id = 0; 871 873 872 874 if ( empty( $id ) ) { 873 875 global $bp; 874 876 $id = !empty( $bp->displayed_user->id ) ? $bp->displayed_user->id : 0; … … 880 882 function bp_loggedin_user_id() { 881 883 882 884 static $id = 0; 883 885 884 886 if ( empty( $id ) ) { 885 887 global $bp; 886 888 $id = !empty( $bp->loggedin_user->id ) ? $bp->loggedin_user->id : 0;