This is the closest I’ve found to what I’ve been having happen.
I’ve got two field groups that when they are both used on the same page, one fails to load its values in the editor.
One is just a handful of fields that are used for a header on certain pages.
The other is a system where I have records of people created on one site in the multisite that I can call and display on pages on other sites.
Recently, when both of those field groups are used on the same page, the simple one fails. It seems to be because it is looking for the content on the other site where the people are called.
to handle the switch to the other site to call up the people, I use this filter:
function mhsl_acf_prepare_who( $field ) {
$this_site_id = get_current_blog_id();
switch_to_blog(5); // 5 is the id of the site where the people are stored
return $field;
switch_to_blog($this_site_id);
}
add_filter('acf/prepare_field/name=who', 'mhsl_acf_prepare_who', 99, 1); // I've tried various priority numbers
I tried filtering the other fields to a higher priority too. No change.
I added it like this and so far it seems to have fixed the problem.
// ensure is_plugin_active() exists (not on frontend)
if( !function_exists('is_plugin_active') ) {
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
}
// bail early if not a plugin (included in theme)
if( !is_plugin_active($basename) ) {
return $transient;
}
Getting this too–self-hosted multisite.
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.