<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[56409] trunk/src/wp-admin: Administration: Apply admin notice functions in multisite.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/56409">56409</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/56409","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>joedolson</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-08-17 21:01:17 +0000 (Thu, 17 Aug 2023)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Administration: Apply admin notice functions in multisite.
Use `wp_get_admin_notice` and `wp_admin_notice` to handle multisite settings notices.
Props costdev.
See <a href="https://core.trac.wordpress.org/ticket/57791">#57791</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpmsthemeslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesnetworkphp">trunk/src/wp-admin/includes/network.php</a></li>
<li><a href="#trunksrcwpadminmysitesphp">trunk/src/wp-admin/my-sites.php</a></li>
<li><a href="#trunksrcwpadminnetworksettingsphp">trunk/src/wp-admin/network/settings.php</a></li>
<li><a href="#trunksrcwpadminnetworksiteinfophp">trunk/src/wp-admin/network/site-info.php</a></li>
<li><a href="#trunksrcwpadminnetworksitenewphp">trunk/src/wp-admin/network/site-new.php</a></li>
<li><a href="#trunksrcwpadminnetworksitesettingsphp">trunk/src/wp-admin/network/site-settings.php</a></li>
<li><a href="#trunksrcwpadminnetworksitethemesphp">trunk/src/wp-admin/network/site-themes.php</a></li>
<li><a href="#trunksrcwpadminnetworksiteusersphp">trunk/src/wp-admin/network/site-users.php</a></li>
<li><a href="#trunksrcwpadminnetworksitesphp">trunk/src/wp-admin/network/sites.php</a></li>
<li><a href="#trunksrcwpadminnetworkthemesphp">trunk/src/wp-admin/network/themes.php</a></li>
<li><a href="#trunksrcwpadminnetworkusernewphp">trunk/src/wp-admin/network/user-new.php</a></li>
<li><a href="#trunksrcwpadminnetworkusersphp">trunk/src/wp-admin/network/users.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpmsthemeslisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -859,7 +859,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> echo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="notice notice-error notice-alt inline hidden"><p></p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ '',
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpadminincludesnetworkphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/network.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/network.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/includes/network.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,11 +125,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $active_plugins = get_option( 'active_plugins' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $active_plugins ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="notice notice-warning"><p><strong>' . __( 'Warning:' ) . '</strong> ' . sprintf(
- /* translators: %s: URL to Plugins screen. */
- __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ),
- admin_url( 'plugins.php?plugin_status=active' )
- ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ '<strong>' . __( 'Warning:' ) . '</strong> ' . sprintf(
+ /* translators: %s: URL to Plugins screen. */
+ __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ),
+ admin_url( 'plugins.php?plugin_status=active' )
+ ),
+ array( 'type' => 'warning' )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> echo '<p>' . __( 'Once the network is created, you may reactivate your plugins.' ) . '</p>';
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</div>';
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/admin-footer.php';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -438,11 +441,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
</span><span class="cx" style="display: block; padding: 0 10px"> <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="notice notice-warning inline"><p>
</del><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_message = '<strong>' . __( 'Caution:' ) . '</strong> ';
+ $notice_args = array(
+ 'type' => 'warning',
+ 'additional_classes' => 'inline',
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( file_exists( $home_path . '.htaccess' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<strong>' . __( 'Caution:' ) . '</strong> ';
- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: wp-config.php, 2: .htaccess */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'You should back up your existing %1$s and %2$s files.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>wp-config.php</code>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -449,8 +456,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>.htaccess</code>'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( file_exists( $home_path . 'web.config' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<strong>' . __( 'Caution:' ) . '</strong> ';
- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: wp-config.php, 2: web.config */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'You should back up your existing %1$s and %2$s files.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>wp-config.php</code>',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -457,16 +463,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>web.config</code>'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<strong>' . __( 'Caution:' ) . '</strong> ';
- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: wp-config.php */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'You should back up your existing %s file.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>wp-config.php</code>'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- </p></div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_admin_notice( $notice_message, $notice_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <ol>
</span></span></pre></div>
<a id="trunksrcwpadminmysitesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/my-sites.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/my-sites.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/my-sites.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,9 +55,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/admin-header.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( $updated ) { ?>
- <div id="message" class="notice notice-success is-dismissible"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div>
-<?php } ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( $updated ) {
+ wp_admin_notice(
+ '<strong>' . __( 'Settings saved.' ) . '</strong>',
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
+}
+?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1 class="wp-heading-inline">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,8 +82,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $blogs ) ) :
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ '<strong>' . __( 'You must be a member of at least one site to use this page.' ) . '</strong>',
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="notice notice-error is-dismissible"><p><strong><?php _e( 'You must be a member of at least one site to use this page.' ); ?></strong></p></div>
</del><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> else :
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span></span></pre></div>
<a id="trunksrcwpadminnetworksettingsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/settings.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/settings.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,9 +138,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/admin-header.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['updated'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Settings saved.' ); ?></p></div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ __( 'Settings saved.' ),
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,24 +172,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $new_admin_email = get_site_option( 'new_admin_email' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $new_admin_email && get_site_option( 'admin_email' ) !== $new_admin_email ) :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div class="notice notice-warning is-dismissible inline">
- <p>
- <?php
- printf(
- /* translators: %s: New network admin email. */
- __( 'There is a pending change of the network admin email to %s.' ),
- '<code>' . esc_html( $new_admin_email ) . '</code>'
- );
- printf(
- ' <a href="%1$s">%2$s</a>',
- esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
- __( 'Cancel' )
- );
- ?>
- </p>
- </div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_message = sprintf(
+ /* translators: %s: New network admin email. */
+ __( 'There is a pending change of the network admin email to %s.' ),
+ '<code>' . esc_html( $new_admin_email ) . '</code>'
+ );
+
+ $notice_message .= sprintf(
+ ' <a href="%1$s">%2$s</a>',
+ esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
+ __( 'Cancel' )
+ );
+
+ wp_admin_notice(
+ $notice_message,
+ array(
+ 'type' => 'warning',
+ 'dismissible' => true,
+ 'additional_classes' => array( 'inline' ),
+ )
+ );
+ endif;
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </td>
</span><span class="cx" style="display: block; padding: 0 10px"> </tr>
</span><span class="cx" style="display: block; padding: 0 10px"> </table>
</span></span></pre></div>
<a id="trunksrcwpadminnetworksiteinfophp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/site-info.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/site-info.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/site-info.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -146,8 +146,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $messages ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_args = array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $messages as $msg ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice( $msg, $notice_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span></span></pre></div>
<a id="trunksrcwpadminnetworksitenewphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/site-new.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/site-new.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/site-new.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -192,8 +192,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <h1 id="add-new-site"><?php _e( 'Add New Site' ); ?></h1>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $messages ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_args = array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $messages as $msg ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice( $msg, $notice_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span></span></pre></div>
<a id="trunksrcwpadminnetworksitesettingsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/site-settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/site-settings.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/site-settings.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,8 +104,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $messages ) ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice_args = array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $messages as $msg ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice( $msg, $notice_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span></span></pre></div>
<a id="trunksrcwpadminnetworksitethemesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/site-themes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/site-themes.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/site-themes.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,7 +196,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Number of themes. */
</span><span class="cx" style="display: block; padding: 0 10px"> $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_admin_notice(
+ sprintf( $message, number_format_i18n( $enabled ) ),
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['disabled'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $disabled = absint( $_GET['disabled'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === $disabled ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -205,9 +213,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Number of themes. */
</span><span class="cx" style="display: block; padding: 0 10px"> $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_admin_notice(
+ sprintf( $message, number_format_i18n( $disabled ) ),
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ __( 'No theme selected.' ),
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminnetworksiteusersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/site-users.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/site-users.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/site-users.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -234,41 +234,57 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['update'] ) ) :
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = '';
+ $type = 'error';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> switch ( $_GET['update'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'adduser':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type = 'success';
+ $message = __( 'User added.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'err_add_member':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'User is already a member of this site.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'err_add_fail':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'User could not be added to this site.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'err_add_notfound':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'Enter the username of an existing user.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'promote':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type = 'success';
+ $message = __( 'Changed roles.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'err_promote':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'Select a user to change role.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'remove':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type = 'success';
+ $message = __( 'User removed from this site.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'err_remove':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'Select a user to remove.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'newuser':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $type = 'success';
+ $message = __( 'User created.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'err_new':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'Enter the username and email.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'err_new_dup':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'Duplicated username or email address.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => $type,
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> endif;
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminnetworksitesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/sites.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/sites.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/sites.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -358,7 +358,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $msg ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $msg = '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $msg = wp_get_admin_notice(
+ $msg,
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminnetworkthemesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/themes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/themes.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/themes.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -367,57 +367,82 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <hr class="wp-header-end">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$message = '';
+$type = 'success';
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['enabled'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $enabled = absint( $_GET['enabled'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === $enabled ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $message = __( 'Theme enabled.' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Number of themes. */
- $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
+ /* translators: %s: Number of themes. */
+ _n( '%s theme enabled.', '%s themes enabled.', $enabled ),
+ number_format_i18n( $enabled )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['disabled'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $disabled = absint( $_GET['disabled'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === $disabled ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $message = __( 'Theme disabled.' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Number of themes. */
- $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
+ /* translators: %s: Number of themes. */
+ _n( '%s theme disabled.', '%s themes disabled.', $disabled ),
+ number_format_i18n( $disabled )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['deleted'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $deleted = absint( $_GET['deleted'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === $deleted ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $message = __( 'Theme deleted.' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Number of themes. */
- $message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
+ /* translators: %s: Number of themes. */
+ _n( '%s theme deleted.', '%s themes deleted.', $deleted ),
+ number_format_i18n( $deleted )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['enabled-auto-update'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $enabled = absint( $_GET['enabled-auto-update'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === $enabled ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $message = __( 'Theme will be auto-updated.' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Number of themes. */
- $message = _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
+ /* translators: %s: Number of themes. */
+ _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled ),
+ number_format_i18n( $enabled )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['disabled-auto-update'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $disabled = absint( $_GET['disabled-auto-update'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 === $disabled ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $message = __( 'Theme will no longer be auto-updated.' );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Number of themes. */
- $message = _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
+ /* translators: %s: Number of themes. */
+ _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled ),
+ number_format_i18n( $disabled )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
</del><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'No theme selected.' );
+ $type = 'error';
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( isset( $_GET['error'] ) && 'main' === $_GET['error'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'You cannot delete a theme while it is active on the main site.' );
+ $type = 'error';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( '' !== $message ) {
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => $type,
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <form method="get">
</span></span></pre></div>
<a id="trunksrcwpadminnetworkusernewphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/user-new.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/user-new.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/user-new.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -107,19 +107,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <h1 id="add-new-user"><?php _e( 'Add New User' ); ?></h1>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '' !== $message ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $message . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div id="message" class="notice notice-error is-dismissible">
- <?php
- foreach ( $add_user_errors->get_error_messages() as $error ) {
- echo "<p>$error</p>";
- }
- ?>
- </div>
-<?php } ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error_messages = '';
+ foreach ( $add_user_errors->get_error_messages() as $error ) {
+ $error_messages .= "<p>$error</p>";
+ }
+
+ wp_admin_notice(
+ $error_messages,
+ array(
+ 'type' => 'error',
+ 'dismissible' => true,
+ 'id' => 'message',
+ 'paragraph_wrap' => false,
+ )
+ );
+}
+?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <form action="<?php echo esc_url( network_admin_url( 'user-new.php?action=add-user' ) ); ?>" id="adduser" method="post" novalidate="novalidate">
</span><span class="cx" style="display: block; padding: 0 10px"> <p><?php echo wp_required_field_message(); ?></p>
</span><span class="cx" style="display: block; padding: 0 10px"> <table class="form-table" role="presentation">
</span></span></pre></div>
<a id="trunksrcwpadminnetworkusersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/network/users.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/network/users.php 2023-08-17 20:27:35 UTC (rev 56408)
+++ trunk/src/wp-admin/network/users.php 2023-08-17 21:01:17 UTC (rev 56409)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -254,29 +254,33 @@
</span><span class="cx" style="display: block; padding: 0 10px"> require_once ABSPATH . 'wp-admin/admin-header.php';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div id="message" class="notice notice-success is-dismissible"><p>
- <?php
- switch ( $_REQUEST['action'] ) {
- case 'delete':
- _e( 'User deleted.' );
- break;
- case 'all_spam':
- _e( 'Users marked as spam.' );
- break;
- case 'all_notspam':
- _e( 'Users removed from spam.' );
- break;
- case 'all_delete':
- _e( 'Users deleted.' );
- break;
- case 'add':
- _e( 'User added.' );
- break;
- }
- ?>
- </p></div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = '';
+ switch ( $_REQUEST['action'] ) {
+ case 'delete':
+ $message = __( 'User deleted.' );
+ break;
+ case 'all_spam':
+ $message = __( 'Users marked as spam.' );
+ break;
+ case 'all_notspam':
+ $message = __( 'Users removed from spam.' );
+ break;
+ case 'all_delete':
+ $message = __( 'Users deleted.' );
+ break;
+ case 'add':
+ $message = __( 'User added.' );
+ break;
+ }
+
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span></span></pre>
</div>
</div>
</body>
</html>