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/admin/bp-core-admin-tools.php

    r10476 r10486  
    428428 */
    429429function bp_admin_reinstall_emails() {
     430    $switched = false;
     431
     432    // Switch to the root blog, where the email posts live.
     433    if ( ! bp_is_root_blog() ) {
     434        switch_to_blog( bp_get_root_blog_id() );
     435        $switched = true;
     436    }
     437
    430438    $emails = get_posts( array(
    431439        'fields'           => 'ids',
     
    445453    bp_core_install_emails();
    446454
     455    if ( $switched ) {
     456        restore_current_blog();
     457    }
     458
    447459    return array( 0, __( 'Emails have been successfully reinstalled.', 'buddypress' ) );
    448460}
Note: See TracChangeset for help on using the changeset viewer.