views:

23

answers:

2

In my plugin, I am trying to get the list of categories available in all the available network website.

Is it possible without writing SQL query?

A: 

I believe you can use: get_all_category_ids()

The function is located in wp-includes\category.php

here is more info: http://codex.wordpress.org/Function_Reference/get_all_category_ids

rxn
A: 

I got the answer. if we 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();
Aman Kumar Jain