So I made ACF called section_image which is an image URL. This ACF is shown on a custom post type taxonomy called Section. All I am trying to do is to get that “section_image” be part of the WP_Term object or maybe find a way to be able to call the image on that specific term i am looping.
The documentation for get_field() explains how to get fields from taxonomy terms. You could either call that in your template, or augment the array your controller returns:
array_map is (quasi-) functional foreach. The first parameter is a callable of some kind (I used an anonymous function here because it allows me to do the whole thing in one “line”), which will receive the value of each row of the array. Whatever that callable returns will be inserted in place of the original row. The second argument is the array.
The following invocations will return the same result: