Skip to:
Content

BuddyPress.org

Changeset 10580


Ignore:
Timestamp:
02/12/2016 02:12:17 PM (9 years ago)
Author:
djpaul
Message:

Core: in BP taxonomy functions, make sure taxonomies are registered.

These functions already use switch_to_blog to ensure we are operating on the root blog context, but as WordPress doesn't update its internal list of registered taxonomies when this happen, core functions that use taxonomy_exists will fail.

By registering our taxonomies if we have to switch blog context, we prevent failures that could otherwise occur in a handful of multisite configurations.

See #6892

Props boonebgorges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-taxonomy.php

    r10536 r10580  
    6565    if ( ! $is_root_blog ) {
    6666        switch_to_blog( bp_get_root_blog_id() );
     67        bp_register_taxonomies();
    6768    }
    6869
     
    9394    if ( ! $is_root_blog ) {
    9495        switch_to_blog( bp_get_root_blog_id() );
     96        bp_register_taxonomies();
    9597    }
    9698
     
    121123    if ( ! $is_root_blog ) {
    122124        switch_to_blog( bp_get_root_blog_id() );
     125        bp_register_taxonomies();
    123126    }
    124127
Note: See TracChangeset for help on using the changeset viewer.