<!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>[56599] trunk/src/wp-admin/includes: Administration: Use `wp_admin_notice()` more in `/wp-admin/includes/`.</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/56599">56599</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/56599","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>costdev</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2023-09-17 15:21:07 +0000 (Sun, 17 Sep 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: Use `wp_admin_notice()` more in `/wp-admin/includes/`.
Adds further usages of `wp_admin_notice()` in `/wp-admin/includes/` on `.notice-error`, `.notice-warning`, `.error`, and `.updated`.
Ongoing task to implement new function across core.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/56408">[56408]</a>, <a href="https://core.trac.wordpress.org/changeset/56409">[56409]</a>, <a href="https://core.trac.wordpress.org/changeset/56410">[56410]</a>, <a href="https://core.trac.wordpress.org/changeset/56518">[56518]</a>, <a href="https://core.trac.wordpress.org/changeset/56570">[56570]</a>, <a href="https://core.trac.wordpress.org/changeset/56571">[56571]</a>, <a href="https://core.trac.wordpress.org/changeset/56572">[56572]</a>, <a href="https://core.trac.wordpress.org/changeset/56573">[56573]</a>, <a href="https://core.trac.wordpress.org/changeset/56576">[56576]</a>, <a href="https://core.trac.wordpress.org/changeset/56589">[56589]</a>, <a href="https://core.trac.wordpress.org/changeset/56590">[56590]</a>, <a href="https://core.trac.wordpress.org/changeset/56597">[56597]</a>.
Props joedolson, mukesh27, costdev.
See <a href="https://core.trac.wordpress.org/ticket/57791">#57791</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclassbulkupgraderskinphp">trunk/src/wp-admin/includes/class-bulk-upgrader-skin.php</a></li>
<li><a href="#trunksrcwpadminincludesclasscustombackgroundphp">trunk/src/wp-admin/includes/class-custom-background.php</a></li>
<li><a href="#trunksrcwpadminincludesclasscustomimageheaderphp">trunk/src/wp-admin/includes/class-custom-image-header.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpplugininstalllisttablephp">trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswppluginslisttablephp">trunk/src/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpprivacypolicycontentphp">trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php</a></li>
<li><a href="#trunksrcwpadminincludesdashboardphp">trunk/src/wp-admin/includes/dashboard.php</a></li>
<li><a href="#trunksrcwpadminincludesfilephp">trunk/src/wp-admin/includes/file.php</a></li>
<li><a href="#trunksrcwpadminincludesmsphp">trunk/src/wp-admin/includes/ms.php</a></li>
<li><a href="#trunksrcwpadminincludesnavmenuphp">trunk/src/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunksrcwpadminincludesnetworkphp">trunk/src/wp-admin/includes/network.php</a></li>
<li><a href="#trunksrcwpadminincludestemplatephp">trunk/src/wp-admin/includes/template.php</a></li>
<li><a href="#trunksrcwpadminincludesupdatephp">trunk/src/wp-admin/includes/update.php</a></li>
<li><a href="#trunksrcwpadminincludesuserphp">trunk/src/wp-admin/includes/user.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclassbulkupgraderskinphp"></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-bulk-upgrader-skin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-bulk-upgrader-skin.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/class-bulk-upgrader-skin.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,10 +143,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</p></div>';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->error || ! $this->result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->error ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="error"><p>' . sprintf( $this->upgrader->strings['skin_update_failed_error'], $title, '<strong>' . $this->error . '</strong>' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $after_error_message = sprintf( $this->upgrader->strings['skin_update_failed_error'], $title, '<strong>' . $this->error . '</strong>' );
</ins><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 '<div class="error"><p>' . sprintf( $this->upgrader->strings['skin_update_failed'], $title ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $after_error_message = sprintf( $this->upgrader->strings['skin_update_failed'], $title );
</ins><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(
+ $after_error_message,
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<script type="text/javascript">jQuery(\'#progress-' . esc_js( $this->upgrader->update_current ) . '\').show();</script>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasscustombackgroundphp"></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-custom-background.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-custom-background.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/class-custom-background.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -256,16 +256,20 @@
</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( $this->updated ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
-<div id="message" class="updated">
- <p>
- <?php
- /* translators: %s: Home URL. */
- printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), esc_url( home_url( '/' ) ) );
- ?>
- </p>
-</div>
- <?php } ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $updated_message = sprintf(
+ /* translators: %s: Home URL. */
+ __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ),
+ esc_url( home_url( '/' ) )
+ );
+ wp_admin_notice(
+ $updated_message,
+ array(
+ 'id' => 'message',
+ 'additional_classes' => array( 'updated' ),
+ )
+ );
+ }
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <h2><?php _e( 'Background Image' ); ?></h2>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasscustomimageheaderphp"></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-custom-image-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-custom-image-header.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/class-custom-image-header.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -524,19 +524,23 @@
</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"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( ! empty( $this->updated ) ) {
+ $updated_message = sprintf(
+ /* translators: %s: Home URL. */
+ __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ),
+ esc_url( home_url( '/' ) )
+ );
+ wp_admin_notice(
+ $updated_message,
+ array(
+ 'id' => 'message',
+ 'additional_classes' => array( 'updated' ),
+ )
+ );
+ }
</ins><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">- <?php if ( ! empty( $this->updated ) ) { ?>
-<div id="message" class="updated">
- <p>
- <?php
- /* translators: %s: Home URL. */
- printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), esc_url( home_url( '/' ) ) );
- ?>
- </p>
-</div>
- <?php } ?>
-
</del><span class="cx" style="display: block; padding: 0 10px"> <h2><?php _e( 'Header Image' ); ?></h2>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <table class="form-table" role="presentation">
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpplugininstalllisttablephp"></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-plugin-install-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-plugin-install-list-table.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -290,10 +290,17 @@
</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"> public function no_items() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $this->error ) ) { ?>
- <div class="inline error"><p><?php echo $this->error->get_error_message(); ?></p>
- <p class="hide-if-no-js"><button class="button try-again"><?php _e( 'Try Again' ); ?></button></p>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $this->error ) ) {
+ $error_message = '<p>' . $this->error->get_error_message() . '</p>';
+ $error_message .= '<p class="hide-if-no-js"><button class="button try-again">' . __( 'Try Again' ) . '</button></p>';
+ wp_admin_notice(
+ $error_message,
+ array(
+ 'additional_classes' => array( 'inline', 'error' ),
+ 'paragraph_wrap' => false,
+ )
+ );
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <?php } else { ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="no-plugin-results"><?php _e( 'No plugins found. Try a different search.' ); ?></div>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswppluginslisttablephp"></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-plugins-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-plugins-list-table.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/class-wp-plugins-list-table.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1282,38 +1282,38 @@
</span><span class="cx" style="display: block; padding: 0 10px"> printf(
</span><span class="cx" style="display: block; padding: 0 10px"> '<tr class="plugin-update-tr">' .
</span><span class="cx" style="display: block; padding: 0 10px"> '<td colspan="%s" class="plugin-update colspanchange">' .
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<div class="update-message notice inline notice-error notice-alt"><p>',
</del><span class="cx" style="display: block; padding: 0 10px"> esc_attr( $this->get_column_count() )
</span><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">+ $incompatible_message = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $compatible_php && ! $compatible_wp ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _e( 'This plugin does not work with your versions of WordPress and PHP.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= __( 'This plugin does not work with your versions of WordPress and PHP.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */
</span><span class="cx" style="display: block; padding: 0 10px"> ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> self_admin_url( 'update-core.php' ),
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url( wp_get_update_php_url() )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_update_php_annotation( '</p><p><em>', '</em>' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= wp_update_php_annotation( '</p><p><em>', '</em>', false );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( current_user_can( 'update_core' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: URL to WordPress Updates screen. */
</span><span class="cx" style="display: block; padding: 0 10px"> ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> self_admin_url( 'update-core.php' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( current_user_can( 'update_php' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: URL to Update PHP page. */
</span><span class="cx" style="display: block; padding: 0 10px"> ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url( wp_get_update_php_url() )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_update_php_annotation( '</p><p><em>', '</em>' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= wp_update_php_annotation( '</p><p><em>', '</em>', false );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( ! $compatible_wp ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _e( 'This plugin does not work with your version of WordPress.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= __( 'This plugin does not work with your version of WordPress.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'update_core' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: URL to WordPress Updates screen. */
</span><span class="cx" style="display: block; padding: 0 10px"> ' ' . __( '<a href="%s">Please update WordPress</a>.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> self_admin_url( 'update-core.php' )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1320,18 +1320,26 @@
</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"> } elseif ( ! $compatible_php ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _e( 'This plugin does not work with your version of PHP.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= __( 'This plugin does not work with your version of PHP.' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( 'update_php' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: URL to Update PHP page. */
</span><span class="cx" style="display: block; padding: 0 10px"> ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url( wp_get_update_php_url() )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_update_php_annotation( '</p><p><em>', '</em>' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incompatible_message .= wp_update_php_annotation( '</p><p><em>', '</em>', false );
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '</p></div></td></tr>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $incompatible_message,
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'notice-alt', 'inline', 'update-message' ),
+ )
+ );
+
+ echo '</td></tr>';
</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="trunksrcwpadminincludesclasswpprivacypolicycontentphp"></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-privacy-policy-content.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,19 +138,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</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">- ?>
- <div class="policy-text-updated notice notice-warning is-dismissible">
- <p>
- <?php
- printf(
- /* translators: %s: Privacy Policy Guide URL. */
- __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
- esc_url( admin_url( 'privacy-policy-guide.php?tab=policyguide' ) )
- );
- ?>
- </p>
- </div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $privacy_message = sprintf(
+ /* translators: %s: Privacy Policy Guide URL. */
+ __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
+ esc_url( admin_url( 'privacy-policy-guide.php?tab=policyguide' ) )
+ );
+
+ wp_admin_notice(
+ $privacy_message,
+ array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'policy-text-updated' ),
+ 'dismissible' => true,
+ )
+ );
</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="trunksrcwpadminincludesdashboardphp"></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/dashboard.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/dashboard.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/dashboard.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -573,9 +573,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form hide-if-no-js">
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( $error_msg ) : ?>
- <div class="error"><?php echo $error_msg; ?></div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( $error_msg ) {
+ wp_admin_notice(
+ $error_msg,
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
+ }
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="input-text-wrap" id="title-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <label for="title">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1157,8 +1164,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success, false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array(), ...$args ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $loading = '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><div class="hide-if-js notice notice-error inline"><p>' . __( 'This widget requires JavaScript.' ) . '</p></div>';
</del><span class="cx" style="display: block; padding: 0 10px"> $doing_ajax = wp_doing_ajax();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $loading = '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p>';
+ $loading .= wp_get_admin_notice(
+ __( 'This widget requires JavaScript.' ),
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'inline', 'hide-if-js' ),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $check_urls ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $widgets = get_option( 'dashboard_widget_options' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1340,25 +1354,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.8.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_print_community_events_markup() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $community_events_notice = '<p class="hide-if-js">' . ( 'This widget requires JavaScript.' ) . '</p>';
+ $community_events_notice .= '<p class="community-events-error-occurred" aria-hidden="true">' . __( 'An error occurred. Please try again.' ) . '</p>';
+ $community_events_notice .= '<p class="community-events-could-not-locate" aria-hidden="true"></p>';
</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="community-events-errors notice notice-error inline hide-if-js">
- <p class="hide-if-js">
- <?php _e( 'This widget requires JavaScript.' ); ?>
- </p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $community_events_notice,
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'community-events-errors', 'inline', 'hide-if-js' ),
+ 'paragraph_wrap' => false,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p class="community-events-error-occurred" aria-hidden="true">
- <?php _e( 'An error occurred. Please try again.' ); ?>
- </p>
-
- <p class="community-events-could-not-locate" aria-hidden="true"></p>
- </div>
-
- <div class="community-events-loading hide-if-no-js">
- <?php _e( 'Loading…' ); ?>
- </div>
-
- <?php
</del><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * Hide the main element when the page first loads, because the content
</span><span class="cx" style="display: block; padding: 0 10px"> * won't be ready until wp.communityEvents.renderEventsTemplate() has run.
</span></span></pre></div>
<a id="trunksrcwpadminincludesfilephp"></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/file.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/file.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/file.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2426,7 +2426,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $error ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $error_string = esc_html( $error->get_error_message() );
</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="error"><p>' . $error_string . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $error_string,
+ array(
+ 'id' => 'message',
+ 'additional_classes' => array( 'error' ),
+ )
+ );
</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"> $types = array();
</span></span></pre></div>
<a id="trunksrcwpadminincludesmsphp"></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/ms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ms.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/ms.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -692,11 +692,20 @@
</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 ( (int) get_site_option( 'wpmu_upgrade_site' ) !== $wp_db_version ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<div class='update-nag notice notice-warning inline'>" . sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upgrade_network_message = sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: URL to Upgrade Network screen. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> esc_url( network_admin_url( 'upgrade.php' ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ) . '</div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
+
+ wp_admin_notice(
+ $upgrade_network_message,
+ array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'update-nag', 'inline' ),
+ 'paragraph_wrap' => false,
+ )
+ );
</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="trunksrcwpadminincludesnavmenuphp"></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/nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/nav-menu.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/nav-menu.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1437,7 +1437,13 @@
</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 ( is_wp_error( $menu_item_db_id ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $messages[] = wp_get_admin_notice(
+ $menu_item_db_id->get_error_message(),
+ array(
+ 'id' => 'message',
+ 'additional_classes' => array( 'error' ),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $menu_items[ $menu_item_db_id ] );
</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-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/network.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,11 +113,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $is_apache;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="error"><p><strong>' . __( 'Error:' ) . '</strong> ' . sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $cannot_define_constant_message = '<strong>' . __( 'Error:' ) . '</strong> ';
+ $cannot_define_constant_message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: DO_NOT_UPGRADE_GLOBAL_TABLES */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'The constant %s cannot be defined when creating a network.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>DO_NOT_UPGRADE_GLOBAL_TABLES</code>'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
+
+ wp_admin_notice(
+ $cannot_define_constant_message,
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
+
</ins><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="cx" style="display: block; padding: 0 10px"> die();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -142,7 +151,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $hostname = get_clean_basedomain();
</span><span class="cx" style="display: block; padding: 0 10px"> $has_ports = strstr( $hostname, ':' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ( false !== $has_ports && ! in_array( $has_ports, array( ':80', ':443' ), true ) ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="error"><p><strong>' . __( 'Error:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ '<strong>' . __( 'Error:' ) . '</strong> ' . __( 'You cannot install a network of sites with your server address.' ),
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> echo '<p>' . sprintf(
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: Port number. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'You cannot use port numbers such as %s.' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,11 +175,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $error_codes = array();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $errors ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="error"><p><strong>' . __( 'Error: The network could not be created.' ) . '</strong></p>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_created_error_message = '<p><strong>' . __( 'Error: The network could not be created.' ) . '</strong></p>';
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $errors->get_error_messages() as $error ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<p>$error</p>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $network_created_error_message .= "<p>$error</p>";
</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>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $network_created_error_message,
+ array(
+ 'additional_classes' => array( 'error' ),
+ 'paragraph_wrap' => false,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> $error_codes = $errors->get_error_codes();
</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">@@ -195,33 +216,39 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $subdomain_install = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $got_mod_rewrite = got_mod_rewrite();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $got_mod_rewrite ) { // Dangerous assumptions.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="updated inline"><p><strong>' . __( 'Note:' ) . '</strong> ';
- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message_class = 'updated';
+ $message = '<p><strong>' . __( 'Warning:' ) . '</strong> ';
+ $message .= '<p>' . sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: mod_rewrite */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Please make sure the Apache %s module is installed as it will be used at the end of this installation.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>mod_rewrite</code>'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- );
- echo '</p>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ) . '</p>';
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $is_apache ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ';
- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message_class = 'error';
+ $message = '<p><strong>' . __( 'Warning:' ) . '</strong> ';
+ $message .= sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: mod_rewrite */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'It looks like the Apache %s module is not installed.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>mod_rewrite</code>'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- );
- echo '</p>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ) . '</p>';
</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 ( $got_mod_rewrite || $is_apache ) { // Protect against mod_rewrite mimicry (but ! Apache).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<p>';
- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message .= '<p>' . sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: mod_rewrite, 2: mod_rewrite documentation URL, 3: Google search for mod_rewrite. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'If %1$s is disabled, ask your administrator to enable that module, or look at the <a href="%2$s">Apache documentation</a> or <a href="%3$s">elsewhere</a> for help setting it up.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>mod_rewrite</code>',
</span><span class="cx" style="display: block; padding: 0 10px"> 'https://httpd.apache.org/docs/mod/mod_rewrite.html',
</span><span class="cx" style="display: block; padding: 0 10px"> 'https://www.google.com/search?q=apache+mod_rewrite'
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ) . '</p>';
+
+ wp_admin_notice(
+ $message,
+ array(
+ 'additional_classes' => array( $message_class, 'inline' ),
+ 'paragraph_wrap' => false,
+ )
</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 '</p></div>';
</del><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">@@ -263,7 +290,14 @@
</span><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"> if ( WP_CONTENT_DIR !== ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="error inline"><p><strong>' . __( 'Warning:' ) . '</strong> ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $subdirectory_warning_message = '<strong>' . __( 'Warning:' ) . '</strong> ';
+ $subdirectory_warning_message .= __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' );
+ wp_admin_notice(
+ $subdirectory_warning_message,
+ array(
+ 'additional_classes' => array( 'error', 'inline' ),
+ )
+ );
</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"> $is_www = str_starts_with( $hostname, 'www.' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -409,7 +443,12 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Wildcard DNS message.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $errors ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="error">' . $errors->get_error_message() . '</div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $errors->get_error_message(),
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
</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 ( $_POST ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -426,8 +465,14 @@
</span><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"> $subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_admin_notice(
+ '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'An existing WordPress network was detected.' ),
+ array(
+ 'additional_classes' => array( 'error' ),
+ )
+ );
</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="error"><p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
</del><span class="cx" style="display: block; padding: 0 10px"> <p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludestemplatephp"></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/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/template.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/template.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1013,10 +1013,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $size = size_format( $bytes );
</span><span class="cx" style="display: block; padding: 0 10px"> $upload_dir = wp_upload_dir();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $upload_dir['error'] ) ) :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div class="error"><p><?php _e( 'Before you can upload your import file, you will need to fix the following error:' ); ?></p>
- <p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $upload_directory_error = '<p>' . __( 'Before you can upload your import file, you will need to fix the following error:' ) . '</p>';
+ $upload_directory_error .= '<p><strong>' . $upload_dir['error'] . '</strong></p>';
+ wp_admin_notice(
+ $upload_directory_error,
+ array(
+ 'additonal_classes' => array( 'error' ),
+ 'paragraph_wrap' => false,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> else :
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1434,16 +1439,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( WP_DEBUG && ! $block_compatible && 'edit' === $screen->parent_base && ! $screen->is_block_editor() && ! isset( $_GET['meta-box-loader'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $plugin = _get_plugin_from_callback( $box['callback'] );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $plugin ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div class="error inline">
- <p>
- <?php
- /* translators: %s: The name of the plugin that generated this meta box. */
- printf( __( 'This meta box, from the %s plugin, is not compatible with the block editor.' ), "<strong>{$plugin['Name']}</strong>" );
- ?>
- </p>
- </div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $meta_box_not_compatible_message = sprintf(
+ /* translators: %s: The name of the plugin that generated this meta box. */
+ __( 'This meta box, from the %s plugin, is not compatible with the block editor.' ),
+ "<strong>{$plugin['Name']}</strong>"
+ );
+ wp_admin_notice(
+ $meta_box_not_compatible_message,
+ array(
+ 'additional_classes' => array( 'error', 'inline' ),
+ )
+ );
</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">@@ -2695,17 +2701,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _local_storage_notice() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div id="local-storage-notice" class="hidden notice is-dismissible">
- <p class="local-restore">
- <?php _e( 'The backup of this post in your browser is different from the version below.' ); ?>
- <button type="button" class="button restore-backup"><?php _e( 'Restore the backup' ); ?></button>
- </p>
- <p class="help">
- <?php _e( 'This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.' ); ?>
- </p>
- </div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $local_storage_message = '<p class="local-restore">';
+ $local_storage_message .= __( 'The backup of this post in your browser is different from the version below.' );
+ $local_storage_message .= '<button type="button" class="button restore-backup">' . __( 'Restore the backup' ) . '</button></p>';
+ $local_storage_message .= '<p class="help">';
+ $local_storage_message .= __( 'This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.' );
+ $local_storage_message .= '</p>';
+
+ wp_admin_notice(
+ $local_storage_message,
+ array(
+ 'id' => 'local-storage-notice',
+ 'additional_classes' => array( 'hidden' ),
+ 'dismissible' => true,
+ 'paragraph_wrap' => false,
+ )
+ );
</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="trunksrcwpadminincludesupdatephp"></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/update.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/update.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/update.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +342,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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo "<div class='update-nag notice notice-warning inline'>$msg</div>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $msg,
+ array(
+ 'type' => 'warning',
+ 'additonal_classes' => array( 'update-nag', 'inline' ),
+ 'paragraph_wrap' => false,
+ )
+ );
</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">@@ -884,7 +891,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $msg = __( 'An automated WordPress update has failed to complete! Please notify the site administrator.' );
</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">- echo "<div class='update-nag notice notice-warning inline'>$msg</div>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $msg,
+ array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'update-nag', 'inline' ),
+ 'paragraph_wrap' => false,
+ )
+ );
</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="trunksrcwpadminincludesuserphp"></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/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/user.php 2023-09-17 02:08:25 UTC (rev 56598)
+++ trunk/src/wp-admin/includes/user.php 2023-09-17 15:21:07 UTC (rev 56599)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -535,28 +535,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'profile.php' === $pagenow || ! get_user_option( 'default_password_nag' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><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="error default-password-nag">
- <p>
- <strong><?php _e( 'Notice:' ); ?></strong>
- <?php _e( 'You are using the auto-generated password for your account. Would you like to change it?' ); ?>
- </p>
- <p>
- <?php
- printf(
- '<a href="%1$s">%2$s</a> | ',
- esc_url( get_edit_profile_url() . '#password' ),
- __( 'Yes, take me to my profile page' )
- );
- printf(
- '<a href="%1$s" id="default-password-nag-no">%2$s</a>',
- '?default_password_nag=0',
- __( 'No thanks, do not remind me again' )
- );
- ?>
- </p>
- </div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $default_password_nag_message = sprintf(
+ '<p><strong>%1$s</strong> %2$s</p>',
+ __( 'Notice:' ),
+ __( 'You are using the auto-generated password for your account. Would you like to change it?' )
+ );
+ $default_password_nag_message .= sprintf(
+ '<p><a href="%1$s">%2$s</a> | ',
+ esc_url( get_edit_profile_url() . '#password' ),
+ __( 'Yes, take me to my profile page' )
+ );
+ $default_password_nag_message .= sprintf(
+ '<a href="%1$s" id="default-password-nag-no">%2$s</a></p>',
+ '?default_password_nag=0',
+ __( 'No thanks, do not remind me again' )
+ );
+
+ wp_admin_notice(
+ $default_password_nag_message,
+ array(
+ 'additional_classes' => array( 'error', 'default-password-nag' ),
+ 'paragraph_wrap' => false,
+ )
+ );
</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>
</div>
</body>
</html>