Skip to:
Content

BuddyPress.org

Changeset 10406


Ignore:
Timestamp:
12/14/2015 03:17:45 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 (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

    r10380 r10406  
    36323632 */
    36333633function bp_group_hidden_fields() {
    3634     if ( isset( $_REQUEST['s'] ) ) {
    3635         echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST['s'] ) . '" name="search_terms" />';
     3634    $query_arg = bp_core_get_component_search_query_arg( 'groups' );
     3635
     3636    if ( isset( $_REQUEST[ $query_arg ] ) ) {
     3637        echo '<input type="hidden" id="search_terms" value="' . esc_attr( $_REQUEST[ $query_arg ] ) . '" name="search_terms" />';
    36363638    }
    36373639
  • branches/2.4/src/bp-members/bp-members-template.php

    r10380 r10406  
    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
  • branches/2.4/src/bp-xprofile/bp-xprofile-filters.php

    r10254 r10406  
    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.