Advanced Custom Fields and Frontend Filters

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Advanced Custom Fields and Frontend Filters

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32557
    tavy87
    tavy87
    Participant

    I’m using advanced custom fields for a select field on User profiles. There are hundreds of options, but only a few are truly used by Users. Is there a way to make a Frontend Filter that can prepopulate only the used options of my custom field? As opposed to using {all_values} which is hundreds of options? Thanks for your help!

    #32572
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I’m afraid no, because there is no efficient way to check which ones are in use. When using the {get_values} statement, the plugin checks which ones are within the post meta table, and prints them. Checking them against the profiles for existence could get exponentially hard (as subqueries would have to be implemented) and may cause huge performance issues.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #32656
    tavy87
    tavy87
    Participant

    Ok thanks for the response. I have a separate question then:

    I’m using the live search with frontend filters, and a custom vertical.php for the search results. I’m currently using ACF in the search results, but I’d like to show 1 of 2 ACF field values depending on one of the frontend filters. I’m unsure how I can access the current search variables from vertical.php. I’m not seeing anything in s_options that would help. Any ideas?

    Thanks

    #32663
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    The query arguments are not passed to that file unfortunately, but there might be a way.

    You could try using the asp_results filters to change the result field according to your needs and print it in the template file. The $args variable contains the generated custom field filters as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.