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!
The ACF site is currently experiencing some issues.— Advanced Custom Fields (@wp_acf) September 29, 2022
We apologize for the inconvenience and we are working hard to get it back up and running as soon as possible.
© 2022 Advanced Custom Fields.