Skip to:
Content

BuddyPress.org

Changeset 10380


Ignore:
Timestamp:
11/25/2015 09:30:35 PM (9 years ago)
Author:
r-a-y
Message:

Make sure search terms are passed when rendering pagination.

r10110 altered the search query parameter for each BuddyPress component
(see #5087). However, we also need to change the search query parameter in
our template loops so pagination will work when a search is in effect.

This commit alters the Members and Groups component template loops to use
the new search query parameter and alters the JS to find the correct search
term value.

See #6745 (2.4-branch).

Location:
branches/2.4/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/src/bp-groups/bp-groups-template.php

    r10342 r10380  
    345345
    346346            if ( ! empty( $search_terms ) ) {
    347                 $add_args['s'] = urlencode( $search_terms );
     347                $query_arg = bp_core_get_component_search_query_arg( 'groups' );
     348                $add_args[ $query_arg ] = urlencode( $search_terms );
    348349            }
    349350
  • branches/2.4/src/bp-members/bp-members-template.php

    r10322 r10380  
    359359
    360360            if ( ! empty( $search_terms ) ) {
    361                 $add_args['s'] = urlencode( $search_terms );
     361                $query_arg = bp_core_get_component_search_query_arg( 'members' );
     362                $add_args[ $query_arg ] = urlencode( $search_terms );
    362363            }
    363364
  • branches/2.4/src/bp-templates/bp-legacy/js/buddypress.js

    r10295 r10380  
    978978            // Search terms
    979979            if ( jq('div.dir-search input').length ) {
    980                 search_terms =  jq('.dir-search input').val();
    981 
    982                 if ( ! search_terms && bp_get_querystring('s') ) {
     980                search_terms =  jq('.dir-search input');
     981
     982                if ( ! search_terms.val() && bp_get_querystring( search_terms.attr( 'name' ) ) ) {
    983983                    search_terms = jq('.dir-search input').prop('placeholder');
     984                } else {
     985                    search_terms = search_terms.val();
    984986                }
    985987            }
Note: See TracChangeset for help on using the changeset viewer.