Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/17/2014 09:56:37 AM (10 years ago)
Author:
djpaul
Message:

Correctly generate pagination links when using AJAX and search terms have been set.
Also improve pagination support for main loops in the Groups/Members/Messages components when JS is disabled.

Fixes #5768, props r-a-y

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-template.php

    r8781 r8931  
    265265
    266266        if ( (int) $this->total_member_count && (int) $this->pag_num ) {
     267            $pag_args = array(
     268                $page_arg => '%#%',
     269            );
     270
     271            if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) {
     272                $base = remove_query_arg( 's', wp_get_referer() );
     273            } else {
     274                $base = '';
     275            }
     276
     277            if ( ! empty( $search_terms ) ) {
     278                $pag_args['s'] = $search_terms;
     279            }
     280
    267281            $this->pag_links = paginate_links( array(
    268                 'base'      => add_query_arg( $page_arg, '%#%' ),
     282                'base'      => add_query_arg( $pag_args, $base ),
    269283                'format'    => '',
    270284                'total'     => ceil( (int) $this->total_member_count / (int) $this->pag_num ),
Note: See TracChangeset for help on using the changeset viewer.