Advanced Search Privacy

This topic contains 1 reply, has 2 voices, and was last updated by  Stiofan O’Connor 6 years ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #428547

    jahusdtc
    Expired Member
    Post count: 162

    I have “private” custom fields.
    Want Admin to have ability to search (Advanced Search works great!), but don’t want anyone else to see the search criteria available.

    Currently, I’ve used CSS to hide it. But of course, someone could read that in View Source, right?

    Any other suggestions to provide Advanced Search for specific user?

    One Advanced Search field is available to everyone, but two are not.

    Thanks for cogitating!

    #428593

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    there is a filter u can use
    “geodir_search_filter_field_output_var_{$htmlvar_name}”

    if your custom field htmlvar name was “website” and your admin ID was 123, you would do this

    
    
    add_filter("geodir_search_filter_field_output_var_geodir_website",'__return_nothing');
    function __return_nothing($html){
    
        if(get_current_user_id() != '123'){ // if user id is not admin id of '123'
            $html = ' '; // empty space
        }
    
        return $html;
    }

    Stiofan

Viewing 2 posts - 1 through 2 (of 2 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket