[wp-trac] [WordPress Trac] #20541: taxonomy_exists doesn't work within switch_to_blog
WordPress Trac
wp-trac at lists.automattic.com
Wed Apr 25 10:34:11 UTC 2012
#20541: taxonomy_exists doesn't work within switch_to_blog
--------------------------+-----------------------------
Reporter: mooontes | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 3.3.1
Severity: normal | Keywords:
--------------------------+-----------------------------
And because of this, wp_get_object_terms doesn't work either
The problem is that "taxonomy_exists" relies on "$wp_taxomies" array that
is not repopulated when using "switch_to_blog".
Example:
Blog ID 1 -> taxonomies: 'companies', 'cities'
[[BR]]Blog ID 2 -> taxonomies: 'brands'
{{{
//We are at Blog 1
switch_to_blog(2);
$brands = wp_get_post_terms($post->ID, 'brands');
//This give us an error of "invalid taxonomy" (it's using blog 1
taxonomies' to check against)
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/20541>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list