Select fields are rendered differently for taxonomy fields than for regular select fields. The regular ones you can alter using the acf/load_field filter, for instance by grouping values in optgroups.
But as taxonomies are rendered using wp_list_categories() and the acf_taxonomy_field_walker, I can’t alter the selectable choices. Instead, in my custom acf/load_field filter, I had to set $field[‘type’] = ‘select’; when presenting a front-end form. Unfortunately, that started messing with the field’s real settings, which now showed up with Field Type: Select (what I did inside the filter hook seems to update the field itself).
Is there any way to get around this?
I partially solved this issues by (obviously…) only applying the filter on front-end pages.
However, $field[‘type’] = ‘select’ it not intuitive and feels like a hack, so I still suggest implementing choices filtering support for taxonomies.
Hi @alexanderwallin
This may be a limitation of using the walker object..
Not sure what we can do for the moment, your hack seems like the most logical solution for the moment.
Thanks
E
Yeah, I suppose. You can send some options to the walker’s construcor, but it’s probably gonna be messy.