diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/network/sites.php --- a/wp/wp-admin/network/sites.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/network/sites.php Fri Sep 05 18:40:08 2025 +0200 @@ -28,23 +28,21 @@ 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => - '

' . __( 'Add New takes you to the Add New Site screen. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.' ) . '

' . - '

' . __( 'This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.' ) . '

' . + '

' . __( 'Add New Site takes you to the screen for adding a new site to the network. You can search for a site by Name, ID number, or IP address. Screen Options allows you to choose how many sites to display on one page.' ) . '

' . + '

' . __( 'This is the main table of all sites on this network. Switch between list and excerpt views by using the icons above the right side of the table.' ) . '

' . '

' . __( 'Hovering over each site reveals seven options (three for the primary site):' ) . '

' . '' . - '

' . __( 'The site ID is used internally, and is not shown on the front end of the site or to users/viewers.' ) . '

' . - '

' . __( 'Clicking on bold headings can re-sort this table.' ) . '

', + '
  • ' . __( 'Delete which is a permanent action after the confirmation screen.' ) . '
  • ' . + '
  • ' . __( 'Visit to go to the front-end of the live site.' ) . '
  • ', ) ); get_current_screen()->set_help_sidebar( '

    ' . __( 'For more information:' ) . '

    ' . - '

    ' . __( 'Documentation on Site Management' ) . '

    ' . - '

    ' . __( 'Support Forums' ) . '

    ' + '

    ' . __( 'Documentation on Site Management' ) . '

    ' . + '

    ' . __( 'Support forums' ) . '

    ' ); get_current_screen()->set_screen_reader_content( @@ -102,7 +100,7 @@ header( 'Content-Type: text/html; charset=utf-8' ); } - if ( get_network()->site_id == $id ) { + if ( is_main_site( $id ) ) { wp_die( __( 'Sorry, you are not allowed to change the current site.' ) ); } @@ -118,8 +116,20 @@ -

    - + +
    +

    +

    + +

    {$site_address}" ); ?>

    + site_id != $id && current_user_can( 'delete_site', $id ) ) { + if ( 0 !== $id && ! is_main_site( $id ) && current_user_can( 'delete_site', $id ) ) { wpmu_delete_blog( $id, true ); $updated_action = 'delete'; } @@ -154,7 +164,7 @@ foreach ( (array) $_POST['site_ids'] as $site_id ) { $site_id = (int) $site_id; - if ( get_network()->site_id == $site_id ) { + if ( is_main_site( $site_id ) ) { continue; } @@ -181,8 +191,10 @@ if ( isset( $_POST['action'] ) && isset( $_POST['allblogs'] ) ) { $doaction = $_POST['action']; - foreach ( (array) $_POST['allblogs'] as $key => $val ) { - if ( '0' != $val && get_network()->site_id != $val ) { + foreach ( (array) $_POST['allblogs'] as $site_id ) { + $site_id = (int) $site_id; + + if ( 0 !== $site_id && ! is_main_site( $site_id ) ) { switch ( $doaction ) { case 'delete': require_once ABSPATH . 'wp-admin/admin-header.php'; @@ -197,12 +209,14 @@ @@ -217,7 +231,7 @@ case 'spam': case 'notspam': $updated_action = ( 'spam' === $doaction ) ? 'all_spam' : 'all_notspam'; - update_blog_status( $val, 'spam', ( 'spam' === $doaction ) ? '1' : '0' ); + update_blog_status( $site_id, 'spam', ( 'spam' === $doaction ) ? '1' : '0' ); break; } } else { @@ -354,7 +368,14 @@ } if ( ! empty( $msg ) ) { - $msg = '

    ' . $msg . '

    '; + $msg = wp_get_admin_notice( + $msg, + array( + 'type' => 'success', + 'dismissible' => true, + 'id' => 'message', + ) + ); } } @@ -367,7 +388,7 @@

    - +