Skip to:
Content

BuddyPress.org

Changeset 10378


Ignore:
Timestamp:
11/25/2015 09:12:19 PM (4 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 (trunk).

Location:
trunk/src
Files:
3 edited

Legend:

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

    r10373 r10378  
    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
  • trunk/src/bp-members/bp-members-template.php

    r10322 r10378  
    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
  • trunk/src/bp-templates/bp-legacy/js/buddypress.js

    r10295 r10378  
    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.