Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/16/2017 11:08:24 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Abstraction: abstract site switching functions to include an is_mulitsite() check.

This allows functions that are traditionally hook-only to be called directly, regardless of the installation type, and without littering the codebase with several is_multisite() switches.

Fixes #3179.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/users/capabilities.php

    r6708 r6734  
    492492    foreach ( (array) array_keys( $blogs ) as $blog_id ) {
    493493
    494         // Switch to the blog ID
    495         switch_to_blog( $blog_id );
     494        // Switch to the site ID
     495        bbp_switch_to_site( $blog_id );
    496496
    497497        // Get topics and replies
     
    518518        }
    519519
    520         // Switch back to current blog
    521         restore_current_blog();
     520        // Switch back to current site
     521        bbp_restore_current_site();
    522522    }
    523523
     
    570570    foreach ( (array) array_keys( $blogs ) as $blog_id ) {
    571571
    572         // Switch to the blog ID
    573         switch_to_blog( $blog_id );
     572        // Switch to the site ID
     573        bbp_switch_to_site( $blog_id );
    574574
    575575        // Get topics and replies
     
    596596        }
    597597
    598         // Switch back to current blog
    599         restore_current_blog();
     598        // Switch back to current site
     599        bbp_restore_current_site();
    600600    }
    601601
Note: See TracChangeset for help on using the changeset viewer.