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-messages/bp-messages-template.php

    r8794 r8931  
    174174
    175175        if ( (int) $this->total_thread_count && (int) $this->pag_num ) {
     176            $pag_args = array(
     177                $page_arg => '%#%',
     178            );
     179
     180            if ( defined( 'DOING_AJAX' ) && true === (bool) DOING_AJAX ) {
     181                $base = remove_query_arg( 's', wp_get_referer() );
     182            } else {
     183                $base = '';
     184            }
     185
     186            if ( ! empty( $this->search_terms ) ) {
     187                $pag_args['s'] = $this->search_terms;
     188            }
     189
    176190            $this->pag_links = paginate_links( array(
    177                 'base'      => add_query_arg( $page_arg, '%#%' ),
     191                'base'      => add_query_arg( $pag_args, $base ),
    178192                'format'    => '',
    179193                'total'     => ceil( (int) $this->total_thread_count / (int) $this->pag_num ),
Note: See TracChangeset for help on using the changeset viewer.