Skip to:
Content

BuddyPress.org

Changeset 10407


Ignore:
Timestamp:
12/14/2015 03:20:30 AM (4 years ago)
Author:
r-a-y
Message:

Use component search parameter instead of hardcoded 's' parameter.

This commit primarily fixes issues with extended profile links using the
older 's' parameter instead of the newer members search query argument.
See #5087.

Props kennibc.

See #6770 (trunk).

Location:
trunk/src
Files:
3 edited

Legend:

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

    r10383 r10407  
    36633663 */
    36643664function bp_group_hidden_fields() {
    3665     if ( isset( $_REQUEST['s'] ) ) {
    3666         echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ) . '" name="search_terms" />';
     3665    $query_arg = bp_core_get_component_search_query_arg( 'groups' );
     3666
     3667    if ( isset( $_REQUEST[ $query_arg ] ) ) {
     3668        echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST[ $query_arg ] ) . '" name="search_terms" />';
    36673669    }
    36683670
  • trunk/src/bp-members/bp-members-template.php

    r10378 r10407  
    13141314 */
    13151315function bp_member_hidden_fields() {
    1316     if ( isset( $_REQUEST['s'] ) )
    1317         echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ) . '" name="search_terms" />';
    1318 
    1319     if ( isset( $_REQUEST['letter'] ) )
     1316    $query_arg = bp_core_get_component_search_query_arg( 'members' );
     1317
     1318    if ( isset( $_REQUEST[ $query_arg ] ) ) {
     1319        echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST[ $query_arg ] ) . '" name="search_terms" />';
     1320    }
     1321
     1322    if ( isset( $_REQUEST['letter'] ) ) {
    13201323        echo '<input type="hidden" id="selected_letter" value="' . esc_attr( $_REQUEST['letter'] ) . '" name="selected_letter" />';
    1321 
    1322     if ( isset( $_REQUEST['members_search'] ) )
     1324    }
     1325
     1326    if ( isset( $_REQUEST['members_search'] ) ) {
    13231327        echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['members_search'] ) . '" name="search_terms" />';
     1328    }
    13241329}
    13251330
  • trunk/src/bp-xprofile/bp-xprofile-filters.php

    r10254 r10407  
    368368                // Less than 5 spaces.
    369369                } else {
    370                     $search_url   = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() );
     370                    $query_arg    = bp_core_get_component_search_query_arg( 'members' );
     371                    $search_url   = add_query_arg( array( $query_arg => urlencode( $value ) ), bp_get_members_directory_permalink() );
    371372                    $new_values[] = '<a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $value . '</a>';
    372373                }
Note: See TracChangeset for help on using the changeset viewer.