Home › Forums › Bug Reports › Bug: acf_get_reference() is returning incorrect field reference › Reply To: Bug: acf_get_reference() is returning incorrect field reference
When ACF gets the reference (field key) it uses the post ID supplied and the field name supplied to get the hidden ACF field key reference. There are only two ways that this can return the key reverence for a different post/post type.
1) The post ID supplied is incorrect
2) The field key reference is the database for them meta key/post ID pair is the wrong field key
Another possibility is that these repeater fields have the same field key. Field keys must be unique. If they are the same then ACF could be getting the definition of the wrong field. But this does not seem likely since you since you are not having a problem in the admin.
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.