Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: display only the list of members who match with a search criterion

@hdcms

Participant

HI,

I’m trying to filter the buddypress members in the list of members and display them in descending order of precedence on a numeric xprofile field (0 to 10).
Example of filter xprofile field “I search” = xprofile field “I am”

I found the function that should work, but I can not do the query:

function my_bp_loop_querystring( $query_string, $object ) {
if ( ! empty( $query_string ) ) {
$query_string .= ‘&’;
}
// $query_string .= ‘per_page=2’; //works
$jerecherche = xprofile_get_field_data(‘Je recherche’, $user_id, $multi_format = ‘comma’ );
$query_string .= ‘search_terms=true&per_page=2’; // <del datetime="2018-01-17T10:23:06+00:00">works</del>

return $query_string;
}
add_action( ‘bp_legacy_theme_ajax_querystring’, ‘my_bp_loop_querystring’, 20, 2 );
Skip to toolbar