Skip to content

Commit

Permalink
Site Cloner: Show sites from all networks (#1090)
Browse files Browse the repository at this point in the history
  • Loading branch information
iandunn authored Oct 16, 2023
1 parent 2f28f25 commit 4e2d26e
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,11 @@ function register_api_endpoints() {
* @return array
*/
function sites_endpoint() {
$sites = array();
$cached_sites = get_site_option( WORDCAMP_SITES_OPTION_KEY, array() );
$sites = array();

// All networks share this option, but it's stored on the WordCamp network because Core doesn't provide a
// cross-network option.
$cached_sites = get_network_option( WORDCAMP_NETWORK_ID, WORDCAMP_SITES_OPTION_KEY, array() );

if ( $cached_sites ) {
unset( $cached_sites[ get_current_blog_id() ] );
Expand All @@ -194,7 +197,9 @@ function prime_wordcamp_sites() {
return;
}

update_site_option( WORDCAMP_SITES_OPTION_KEY, get_wordcamp_sites() );
// All networks share this option, but it's stored on the WordCamp network because Core doesn't provide a
// cross-network option.
update_network_option( WORDCAMP_NETWORK_ID, WORDCAMP_SITES_OPTION_KEY, get_wordcamp_sites() );
}

/**
Expand Down

0 comments on commit 4e2d26e

Please sign in to comment.