Changeset 9520
- Timestamp:
- 02/20/2015 06:48:40 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/src/bp-core/bp-core-taxonomy.php
r9210 r9520 38 38 */ 39 39 function bp_set_object_terms( $object_id, $terms, $taxonomy, $append = false ) { 40 if ( ! bp_is_root_blog() ) { 40 $is_root_blog = bp_is_root_blog(); 41 42 if ( ! $is_root_blog ) { 41 43 switch_to_blog( bp_get_root_blog_id() ); 42 44 } … … 44 46 $retval = wp_set_object_terms( $object_id, $terms, $taxonomy, $append ); 45 47 46 restore_current_blog(); 48 if ( ! $is_root_blog ) { 49 restore_current_blog(); 50 } 47 51 48 52 return $retval; … … 62 66 */ 63 67 function bp_get_object_terms( $object_ids, $taxonomies, $args = array() ) { 64 if ( ! bp_is_root_blog() ) { 68 $is_root_blog = bp_is_root_blog(); 69 70 if ( ! $is_root_blog ) { 65 71 switch_to_blog( bp_get_root_blog_id() ); 66 72 } … … 68 74 $retval = wp_get_object_terms( $object_ids, $taxonomies, $args ); 69 75 70 restore_current_blog(); 76 if ( ! $is_root_blog ) { 77 restore_current_blog(); 78 } 71 79 72 80 return $retval;
Note: See TracChangeset
for help on using the changeset viewer.