• Resolved nknov12

    (@nknov12)


    Hi, I have defined this ACF filter. This works in ACF backend form, but doesn’t work in Frontend form

    While defining the Frontend form, I have tried both including the full set of fields in ACF group, as well as just the individual field in ACF. The form returns all terms in the taxonomy ignoring the filter.

    What could be the reason?

    add_filter('acf/fields/taxonomy/wp_list_categories/name=item_type_taxonomy', 'custom_taxonomy_filter', 10, 2);
    add_filter('acf/fields/taxonomy/query/name=item_type_taxonomy', 'custom_taxonomy_filter', 10, 2);
    function custom_taxonomy_filter($args, $field) {
         // Limit the terms to specific term ids in the specified order
         $args['include'] = array(5168,5175);
         return $args;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shabti Kaplan

    (@shabti)

    This happens a lot so I will build a fix into the plugin, but for now duplicate the first two lines and change acf/fields/taxonomy to acf/fields/related_terms

    Thread Starter nknov12

    (@nknov12)

    Yes Shabti, it started working.

    Appreciate the help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ACF filter not working in Frontend. Works in ACF though’ is closed to new replies.