Getting list of categories available in all wordpress NETWORK sites
I was recently writing a wordpress network site plugin which required me to fetch list of categories in all network sites. After reading the documentation I figured out the following possible way: if we can get all the blog id’s in an array $blog_id_list , then we can do:
foreach($blog_id_list as $blog_id)
{
switch_to_blog($blog_id);
get_categories(); //use it as required.
}
restore_current_blog();