$id =
isset( $_REQUEST['id'
] ) ?
(int) $_REQUEST['id'
] : 0;
if ( !
$id ) { wp_die( __( 'Invalid site ID.'
) );
}$details =
get_site( $id );
if ( !
$details ) { wp_die( __( 'The requested site does not exist.'
) );
}if ( !
can_edit_network( $details->site_id
) ) { wp_die( __( 'Sorry, you are not allowed to access this page.'
), 403
);
}$parsed_scheme =
parse_url( $details->siteurl, PHP_URL_SCHEME
);
$is_main_site =
is_main_site( $id );
if ( isset( $_REQUEST['action'
] ) && 'update-site' ===
$_REQUEST['action'
] ) { check_admin_referer( 'edit-site'
);
switch_to_blog( $id );