I’m trying to get the ACF Relationship field to list Taxonomies in the selection meta field. I’ve been looking for a solution for a while but just can’t find or figure out the code to do it. I cant use a taxonomy field here because I need the user to be able to select any post, page, etc., and in my specific case, the actual category page, to the selection.
Im not looking to filter by taxonomies as i know that is already an option.
The results for instance would then allow me to show a list from the selected posts, pages, etc., and “categories”.
for example:
– Hello world! (post)
– Things to do… (page)
– New Years Party (event / etc.)
– Biking (category)
My guess is to somehow add the categories to the arguments in a function for this specific field.
something like:
function add_categories_to_relationship($args, $field, $post_id)
{
//1: add categories pages to selection
$args['???'] = array('category');
return $args;
}
add_filter('acf/fields/relationship/query/key=field_60c258b4efd79', 'add_categories_to_relationship', 10, 3);
any help would be much appreciated.