Changeset 6734
- Timestamp:
- 11/16/2017 11:08:24 PM (7 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/admin/actions.php
r6730 r6734 143 143 } 144 144 145 // Switch to the new blog146 switch_to_blog( $blog_id );145 // Switch to the new site 146 bbp_switch_to_site( $blog_id ); 147 147 148 148 // Do the bbPress activation routine 149 149 do_action( 'bbp_new_site', $blog_id, $user_id, $domain, $path, $site_id, $meta ); 150 150 151 // restore original blog152 restore_current_blog();151 // Restore original site 152 bbp_restore_current_site(); 153 153 } 154 154 -
trunk/src/includes/admin/classes/class-bbp-admin.php
r6705 r6734 1136 1136 } 1137 1137 1138 // Switch to the new blog1139 switch_to_blog( $details[ 'blog_id' ] );1138 // Switch to the new site 1139 bbp_switch_to_site( $details[ 'blog_id' ] ); 1140 1140 1141 1141 $basename = bbpress()->basename; … … 1146 1146 } 1147 1147 1148 // restore original blog1149 restore_current_blog();1148 // Restore original site 1149 bbp_restore_current_site(); 1150 1150 1151 1151 // Do some actions to allow plugins to do things too -
trunk/src/includes/admin/common.php
r6730 r6734 156 156 } 157 157 158 switch_to_blog( $site_id );158 bbp_switch_to_site( $site_id ); 159 159 bbp_delete_options(); 160 160 bbp_remove_roles(); 161 161 bbp_remove_caps(); 162 162 flush_rewrite_rules(); 163 restore_current_blog();163 bbp_restore_current_site(); 164 164 } 165 165 -
trunk/src/includes/core/abstraction.php
r6723 r6734 335 335 } 336 336 337 /** 338 * Switch to a site in a multisite installation. 339 * 340 * If not a multisite installation, no switching will occur. 341 * 342 * @since 2.6.0 bbPress (r6733) 343 * 344 * @param int $site_id 345 */ 346 function bbp_switch_to_site( $site_id = 0 ) { 347 348 // Switch to a specific site 349 if ( is_multisite() ) { 350 switch_to_blog( $site_id ); 351 } 352 } 353 354 /** 355 * Switch back to the original site in a multisite installation. 356 * 357 * If not a multisite installation, no switching will occur. 358 * 359 * @since 2.6.0 bbPress (r6733) 360 */ 361 function bbp_restore_current_site( ) { 362 363 // Switch back to the original site 364 if ( is_multisite() ) { 365 restore_current_blog(); 366 } 367 } 368 337 369 /** Engagements ***************************************************************/ 338 370 -
trunk/src/includes/core/capabilities.php
r6573 r6734 326 326 * bbPress does not have an intercept point to add its dynamic roles. 327 327 * 328 * @see switch_to_blog()329 * @see restore_current_blog()328 * @see bbp_switch_to_site() 329 * @see bbp_restore_current_site() 330 330 * @see WP_Roles::_init() 331 331 * -
trunk/src/includes/users/capabilities.php
r6708 r6734 492 492 foreach ( (array) array_keys( $blogs ) as $blog_id ) { 493 493 494 // Switch to the blogID495 switch_to_blog( $blog_id );494 // Switch to the site ID 495 bbp_switch_to_site( $blog_id ); 496 496 497 497 // Get topics and replies … … 518 518 } 519 519 520 // Switch back to current blog521 restore_current_blog();520 // Switch back to current site 521 bbp_restore_current_site(); 522 522 } 523 523 … … 570 570 foreach ( (array) array_keys( $blogs ) as $blog_id ) { 571 571 572 // Switch to the blogID573 switch_to_blog( $blog_id );572 // Switch to the site ID 573 bbp_switch_to_site( $blog_id ); 574 574 575 575 // Get topics and replies … … 596 596 } 597 597 598 // Switch back to current blog599 restore_current_blog();598 // Switch back to current site 599 bbp_restore_current_site(); 600 600 } 601 601
Note: See TracChangeset
for help on using the changeset viewer.