Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/18/2020 12:54:41 PM (3 years ago)
Author:
slaffik
Message:

Tools: add WP MultiSite checks for "Repair site tracking site icons" operation

On regular sites checking and running the "Repair site tracking site icons" operation on the Tools > BuddyPress page generates a fatal error due to the get_sites() function usage, which is MultiSite specific. So, hide the operation on non-multisite and properly return an error when ran directly.

Fixes #8414 (Trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/admin/bp-core-admin-tools.php

    r12779 r12826  
    145145        );
    146146
    147         if ( bp_is_active( 'blogs', 'site-icon' ) ) {
     147        if ( is_multisite() && bp_is_active( 'blogs', 'site-icon' ) ) {
    148148            $repair_list[91] = array(
    149149                'bp-blog-site-icons',
     
    332332    /* translators: %s: the result of the action performed by the repair tool */
    333333    $statement = __( 'Repairing site icons/blog avatars synchronization… %s', 'buddypress' );
     334
     335    if ( ! is_multisite() ) {
     336        return array( 0, sprintf( $statement, __( 'Failed!', 'buddypress' ) ) );
     337    }
    334338
    335339    // Run function if blogs component is active.
Note: See TracChangeset for help on using the changeset viewer.