Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/31/2016 05:30:30 PM (4 years ago)
Author:
djpaul
Message:

Emails: make sure we are on root blog when redirecting to email customiser, or running the email repair tool.

See #6592

File:
1 edited

Legend:

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

    r10475 r10486  
    393393 */
    394394function bp_email_redirect_to_customizer() {
     395    $switched = false;
     396
     397    // Switch to the root blog, where the email posts live.
     398    if ( ! bp_is_root_blog() ) {
     399        switch_to_blog( bp_get_root_blog_id() );
     400        $switched = true;
     401    }
     402
    395403    $email = get_posts( array(
    396404        'fields'           => 'ids',
     
    418426    );
    419427
     428    if ( $switched ) {
     429        restore_current_blog();
     430    }
     431
    420432    printf(
    421433        '<script type="text/javascript">window.location = "%s";</script>',
Note: See TracChangeset for help on using the changeset viewer.