Niche issue with ACF FontAwesome plugin - need to emulate {term_id} in PHP

This plugin:

Allows me to have an icon picker for my categories.
I have a TERMS query loop - which gets all parent categories. I want to list them with the icon and term name.
I can get the term with bricks fields. I can get a custom category desc with ACF field - but Bricks doesn’t list the icon field - it just ignores it.
I want to work-around this with custom code - because - get_field(‘category_icon’, ‘category_22’); gets the icon fine.
But I have no idea how to get the ID of the category within the loop. get_queried_object_id() returns null. {term_id} works fine - but I can’t use it in code.
So - how do I emulate {term_id} - in a php block within the loop?
Many thanks

Try $term_id = \Bricks\Query::get_loop_object_id();.

This made me so happy I peed a little :smiley: - thank you

1 Like