Support

Account

Home Forums General Issues Is it possible to use multiple taxonomies in the taxonomy field?

Solved

Is it possible to use multiple taxonomies in the taxonomy field?

  • The title says it: is it possible to query multiple taxonomies for their terms, using the taxonomy field?

    So far I’ve tried:

    – setting the new taxonomy field’s "taxonomy" value to array("category", "taxonomy2") rather than just "category"

    – using the acf/fields/taxonomy/query filter to set $args["taxonomy"] to array("category", "taxonomy2")

    I’m using "select" as the "field_type".

    The first option does work in that terms from both taxonomies are output in the select box (albeit all together rather than grouped by tax), but it also prints a warning & a couple of notices: ‘Illegal offset type in isset or empty’ in wp-includes/taxonomy :240 & ‘Trying to get property of non-object’ in acf-pro/fields/taxonomy :578 (twice).

    The second option appears to be ignored and whatever is set as the taxonomy on the definition of the field is used instead.

    I might be missing something… is it possible to use multiple taxonomies in the taxonomy field? Or would this instead be a feature request?

  • Hi @tdmalone

    I’m afraid you can’t do it. Since WordPress needs you to provide the taxonomy to get the term, ACF needs it too if you want to return the taxonomy field as a term object. If you set it to multiple taxonomies, ACF won’t be able to know which taxonomy does a term comes from.

    I hope this makes sense. Thanks!

  • Thanks James, that makes sense. 🙂

    Can I submit this as a feature request? I think it would be possible but would obviously require a bit of work. Let me know if you’d rather me re-post this in the feature requests forum.

  • Hi @tdmalone

    I’ll pass this thread to the plugin author so you don’t have to create a new thread. Hope he will add it in the future 🙂

    Thanks!

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

The topic ‘Is it possible to use multiple taxonomies in the taxonomy field?’ is closed to new replies.