Home › Forums › Bug Reports › Bug: acf_get_reference() is returning incorrect field reference › Reply To: Bug: acf_get_reference() is returning incorrect field reference
So I am also creating the post dynamically using
wp_insert_post() WP function. Is it possible that during this creation, ACF somehow gets the reference of a different post/post type?
1) the post ID is correct as it works for all other non-repeater fields.
2) yes, you are right here. that’s what I mean, the key/post ID pair seems to be wrong in the database.
As for the same key, so the repeater fields have same field key but they are showing on totally different post types. e.g., one repeater field with
_products that has 6 sub-fields is showing on “post type A” and another repeater field with
_products that has only 3 sub-fields is showing on “post type B”. So this should not be an issue.
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!