Skip to main content
Notice removed Draw attention by Sagive
Bounty Ended with Oleg Butuzov's answer chosen by Sagive
Notice added Draw attention by Sagive
Bounty Started worth 50 reputation by Sagive
added 495 characters in body
Source Link
Sagive
  • 2.8k
  • 2
  • 35
  • 54

I have a father blog / main blog inside a multisite that has a specific taxonomy with 20+ terms inside it. i just need a list of all the terms inside that taxonomy...

i dont mind quering using WPDB but just dont know to how to write it correctly or in any other way i tried use: "switch_to_blog" but that doesnt work when quering terms

Any suggestion?
i tried the: Multisite Global Terms plugin (doesnt work)...

EDIT (response to question in comment)
this is an example of switch_to_blog i tried:

function multisite_profession_select(){
    
        switch_to_blog(1);
        
        $taxonomies = array('rsitecat');
        $args       = array('hide_empty' => false);
        $terms      = get_terms($taxonomies, $args );
        
        echo '<pre>';
        print_r($terms);
        echo '</pre>';
        
        restore_current_blog();
        
    }

The reponse i get:

WP_ERROR OBJECT
(
    [ERRORS] => ARRAY
        (
            [INVALID_TAXONOMY] => ARRAY
                (
                    [0] => INVALID TAXONOMY
                )

        )

    [ERROR_DATA] => ARRAY
        (
        )

)

I have a father blog / main blog inside a multisite that has a specific taxonomy with 20+ terms inside it. i just need a list of all the terms inside that taxonomy...

i dont mind quering using WPDB but just dont know to how to write it correctly or in any other way i tried use: "switch_to_blog" but that doesnt work when quering terms

Any suggestion?
i tried the: Multisite Global Terms plugin (doesnt work)...

I have a father blog / main blog inside a multisite that has a specific taxonomy with 20+ terms inside it. i just need a list of all the terms inside that taxonomy...

i dont mind quering using WPDB but just dont know to how to write it correctly or in any other way i tried use: "switch_to_blog" but that doesnt work when quering terms

Any suggestion?
i tried the: Multisite Global Terms plugin (doesnt work)...

EDIT (response to question in comment)
this is an example of switch_to_blog i tried:

function multisite_profession_select(){
    
        switch_to_blog(1);
        
        $taxonomies = array('rsitecat');
        $args       = array('hide_empty' => false);
        $terms      = get_terms($taxonomies, $args );
        
        echo '<pre>';
        print_r($terms);
        echo '</pre>';
        
        restore_current_blog();
        
    }

The reponse i get:

WP_ERROR OBJECT
(
    [ERRORS] => ARRAY
        (
            [INVALID_TAXONOMY] => ARRAY
                (
                    [0] => INVALID TAXONOMY
                )

        )

    [ERROR_DATA] => ARRAY
        (
        )

)
Source Link
Sagive
  • 2.8k
  • 2
  • 35
  • 54

Get all terms inside a specific taxonomy in a multisite

I have a father blog / main blog inside a multisite that has a specific taxonomy with 20+ terms inside it. i just need a list of all the terms inside that taxonomy...

i dont mind quering using WPDB but just dont know to how to write it correctly or in any other way i tried use: "switch_to_blog" but that doesnt work when quering terms

Any suggestion?
i tried the: Multisite Global Terms plugin (doesnt work)...