I got the solution. It’s very simple. $logo = get_field('field_53368dabb411e', 'manufacturer_'.$m->term_id);
As documentation says that we can pass POST ID as second argument, This can also be options / taxonomies / users / etc.
Now I have to work with custom taxonomy. So if I pass taxonomy term id as second parameter, it doesn’t work. It search value in wp_postmeta table, which is wrong. Because ACF didn’t store taxonomy/relationship field data in wp_postmeta table. It stores in wp_options table.
So now problem is how to pass argument that ACF get actual value. I search all code related to relationship field and how ACF insert & get data from DB. I just concat the taxonomy slug + ‘_’ + taxonomy term id and I got my result.
I don’t know whether this is bug is plugin or they forgot to update or mention in documentation, but I got my desired result with this hack.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users