Instantly share code, notes, and snippets.

Embed
What would you like to do?
Wrapper for bulk actions in WP MU install [Wordpress]
if ( is_multisite()) {
$sites = get_sites();
foreach ($sites as $site ) {
$blog_id = $site->blog_id;
//if ($blog_id < 6 ){//if we need certain blogs
switch_to_blog( $blog_id );
wp_suspend_cache_addition(true);
//here what we gonna do...
wp_suspend_cache_addition(false);
restore_current_blog();
//}//endif $blog_id
sleep(3); // this should pause for 3 seconds for every loop
}//endforeach
}//endif multisite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment