diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/includes/ms.php --- a/wp/wp-admin/includes/ms.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/includes/ms.php Fri Sep 05 18:40:08 2025 +0200 @@ -8,7 +8,7 @@ */ /** - * Determine if uploaded file exceeds space quota. + * Determines whether uploaded file exceeds space quota. * * @since 3.0.0 * @@ -53,19 +53,15 @@ } /** - * Delete a site. + * Deletes a site. * * @since 3.0.0 * @since 5.1.0 Use wp_delete_site() internally to delete the site row from the database. * - * @global wpdb $wpdb WordPress database abstraction object. - * * @param int $blog_id Site ID. * @param bool $drop True if site's database tables should be dropped. Default false. */ function wpmu_delete_blog( $blog_id, $drop = false ) { - global $wpdb; - $blog_id = (int) $blog_id; $switch = false; @@ -130,16 +126,21 @@ } /** - * Delete a user from the network and remove from all sites. + * Deletes a user and all of their posts from the network. + * + * This function: + * + * - Deletes all posts (of all post types) authored by the user on all sites on the network + * - Deletes all links owned by the user on all sites on the network + * - Removes the user from all sites on the network + * - Deletes the user from the database * * @since 3.0.0 * - * @todo Merge with wp_delete_user()? - * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $id The user ID. - * @return bool True if the user was deleted, otherwise false. + * @return bool True if the user was deleted, false otherwise. */ function wpmu_delete_user( $id ) { global $wpdb; @@ -213,7 +214,7 @@ } /** - * Check whether a site has used its allotted upload space. + * Checks whether a site has used its allotted upload space. * * @since MU (3.0.0) * @@ -269,12 +270,12 @@ } /** - * Get the remaining upload space for this site. + * Gets the remaining upload space for this site. * * @since MU (3.0.0) * - * @param int $size Current max size in bytes - * @return int Max size in bytes + * @param int $size Current max size in bytes. + * @return int Max size in bytes. */ function fix_import_form_size( $size ) { if ( upload_is_user_over_quota( false ) ) { @@ -304,8 +305,15 @@ - - + + + + slug = sanitize_title( $term->name ); - } else { - $term['slug'] = sanitize_title( $term['name'] ); - } - } - return $term; -} - -/** * Displays an access denied message when a user tries to view a site's dashboard they * do not have access to. * @@ -709,11 +694,20 @@ } if ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) { - echo "
" . sprintf( + $upgrade_network_message = sprintf( /* translators: %s: URL to Upgrade Network screen. */ __( 'Thank you for Updating! Please visit the Upgrade Network page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) - ) . '
'; + ); + + wp_admin_notice( + $upgrade_network_message, + array( + 'type' => 'warning', + 'additional_classes' => array( 'update-nag', 'inline' ), + 'paragraph_wrap' => false, + ) + ); } } @@ -751,7 +745,7 @@ while ( $c < 10 && get_id_from_blogname( $post_name ) ) { $post_name .= mt_rand( 1, 10 ); - $c++; + ++$c; } if ( $post_name !== $data['post_name'] ) { @@ -806,7 +800,7 @@ update_user_meta( get_current_user_id(), 'primary_blog', $blog->userblog_id ); } } else { - echo 'N/A'; + _e( 'Not available' ); } ?> @@ -816,7 +810,7 @@ } /** - * Whether or not we can edit this network from this page. + * Determines whether or not this network from this page can be edited. * * By default editing of network is restricted to the Network Admin for that `$network_id`. * This function allows for this to be overridden. @@ -824,7 +818,7 @@ * @since 3.1.0 * * @param int $network_id The network ID to check. - * @return bool True if network can be edited, otherwise false. + * @return bool True if network can be edited, false otherwise. */ function can_edit_network( $network_id ) { if ( get_current_network_id() === (int) $network_id ) { @@ -845,7 +839,7 @@ } /** - * Thickbox image paths for Network Admin. + * Prints thickbox image paths for Network Admin. * * @since 3.1.0 * @@ -861,6 +855,7 @@ /** * @param array $users + * @return bool */ function confirm_delete_users( $users ) { $current_user = wp_get_current_user(); @@ -938,8 +933,11 @@ ); if ( is_array( $blog_users ) && ! empty( $blog_users ) ) { - $user_site = "{$details->blogname}"; - $user_dropdown = ''; + $user_site = "{$details->blogname}"; + $user_dropdown = ''; $user_dropdown .= "