Skip to content

Commit

Permalink
Add support for single site and multisite installs
Browse files Browse the repository at this point in the history
  • Loading branch information
claytoncollie committed Dec 17, 2021
1 parent d3768cd commit a2dc546
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion includes/class-simple-local-avatars.php
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,17 @@ public function migrate_from_wp_user_avatar() {
global $wpdb;

$count = 0;
$sites = get_sites();

// Support single site and multisite installs.
// Use WordPress function if running multisite.
// Create generic class if running single site.
if ( is_multisite() ) {
$sites = get_sites();
} else {
$site = new stdClass();
$site->blog_id = 1;
$sites = array( $site );
}

// Bail early if we don't find sites.
if ( empty( $sites ) ) {
Expand Down

0 comments on commit a2dc546

Please sign in to comment.