Home › Forums › Bug Reports › Bug: acf_get_reference() is returning incorrect field reference › Reply To: Bug: acf_get_reference() is returning incorrect field reference
1) Yes, I first create the post and get the post ID. And then pass it down to the fields.
2) Ah, that’s a good point. So you mean that if the fields do not exist, then we must use field key (e.g., field_1231231
) instead of the field name (e.g., _products
)? However, my client is how do I get the field key programmatically by providing the field name? if possible at all?
Sorry, I confused field key with field name. Yes, field keys (e.g., field_123123
) are unique throughout the site in all field groups. Only field names (e.g., _products
) are being used in multiple field groups.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.