Home › Forums › ACF PRO › Dynamically generate relationship multisite › Reply To: Dynamically generate relationship multisite
So, the problem is that when the field is loading after saving the post ID values do not exist on the current site.
When ACF renders the field it does this
// get posts
$posts = acf_get_posts(array(
'post__in' => $field['value'],
'post_type' => $field['post_type']
));
the function acf_get_posts() in api-helpers.php is where you need to look. I’m not sure if you can do anything there. I think that you need to find a way to switch sites before acf renders the field and then switch back after acf renders the field. I would try this hook https://www.advancedcustomfields.com/resources/acf-render_field/, twice, low priority to switch to the main site and high priority to restore the current blog.
again, I don’t know if it will work.
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.