Home › Forums › Bug Reports › Bug: ACF Pro 5.2.3 and WP Multisite › Reply To: Bug: ACF Pro 5.2.3 and WP Multisite
I tested it out on one of my affected installs. Simply putting the restore_current_blog() inside the loop did not work. However through some trial and error I was able to get it working by keeping your original code and adding it inside the loop like so.
// loop through sites and find updates
$sites = wp_get_sites();
if( $sites ) {
foreach( $sites as $site ) {
// switch blog
switch_to_blog( $site['blog_id'] );
// get site updates
$updates = acf_get_updates();
if( $updates ) {
$prompt = true;
break;
}
// restore
restore_current_blog();
}
// restore
restore_current_blog();
}
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 most recent ACF Chat Friday featured a live demo of how to register CPTs directly in the plugin, one of our most requested features. Check out the summary below for a replay of the demo, and don’t forget to register for the next session! https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 9, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.