Skip to:
Content
Pages
Categories
Search
Top
Bottom

filter the buddypress members in the list of members


  • HDcms
    Participant

    @hdcms

    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’; // does not work
    
    return $query_string;
    }
    add_action( ‘bp_legacy_theme_ajax_querystring’, ‘my_bp_loop_querystring’, 20, 2 );
  • You must be logged in to reply to this topic.
Skip to toolbar