get_term_by works but get_terms doesn’t?

Question

I currently have a Multisite with 2 sites.

From the secondary site get_term_by() works to retrieve terms from the primary site, but get_terms() does not.

I’m using switch_to_blog(1); but I get object(WP_Error)#1316 (2) { ["errors"]=> array(1) { ["invalid_taxonomy"]=> array(1) { [0]=> string(16) "Invalid taxonomy" } } ["error_data"]=> array(0) { } } when I run get_terms()

Is there a way around this?

0
, , , Austin Biggs 3 years 2020-08-28T03:11:26-05:00 0 Answers 58 views 0

Leave an answer

Browse
Browse