Skip to:
Content
Pages
Categories
Search
Top
Bottom

API Function to check if search is active in Members Loop


  • sx1001
    Participant

    @sx1001

    Hi all,

    is there a function in the API of bp which returns a bool to see, if a search is active in the members loop? I found some piece in a plugin, dont remember where, which I just dont understand. It works, but takes some time – so not sure if there’s a better way:

    
    $request = bp_ps_get_request('search');
    $request_keys = array_keys($request);
    if (!empty($request_keys)) {
        $valid = bp_ps_search($request); 
        if ($valid['validated']) {
            // Search is active...
            
        }
    }
    

    Apart from that:
    I know I can change the maximum displayed members in the loop, but is there also a function which directly limits the number of returned members within the search itself to a maximum number?

    Thanks

  • You must be logged in to reply to this topic.
Skip to toolbar