<!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>[56570] trunk/src: Administration: Use `wp_admin_notice()` in `/wp-admin/`.</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/56570">56570</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/56570","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-09-14 00:52:45 +0000 (Thu, 14 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()` in `/wp-admin/`.
Add usages of `wp_admin_notice()` and `wp_get_admin_notice()` on `.notice-[type]` in the root level of `/wp-admin/`. Ongoing task to implement new function across core.
Props costdev, joedolson.
See <a href="https://core.trac.wordpress.org/ticket/57791">#57791</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmin_indexphp">trunk/src/wp-admin/_index.php</a></li>
<li><a href="#trunksrcwpadminauthorizeapplicationphp">trunk/src/wp-admin/authorize-application.php</a></li>
<li><a href="#trunksrcwpadmincommentphp">trunk/src/wp-admin/comment.php</a></li>
<li><a href="#trunksrcwpadmineditformadvancedphp">trunk/src/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunksrcwpadmineditformblocksphp">trunk/src/wp-admin/edit-form-blocks.php</a></li>
<li><a href="#trunksrcwpadminedittagformphp">trunk/src/wp-admin/edit-tag-form.php</a></li>
<li><a href="#trunksrcwpadminoptionsprivacyphp">trunk/src/wp-admin/options-privacy.php</a></li>
<li><a href="#trunksrcwpadminoptionsreadingphp">trunk/src/wp-admin/options-reading.php</a></li>
<li><a href="#trunksrcwpadminoptionsphp">trunk/src/wp-admin/options.php</a></li>
<li><a href="#trunksrcwpadminplugineditorphp">trunk/src/wp-admin/plugin-editor.php</a></li>
<li><a href="#trunksrcwpadminprivacypolicyguidephp">trunk/src/wp-admin/privacy-policy-guide.php</a></li>
<li><a href="#trunksrcwpadminsiteeditorphp">trunk/src/wp-admin/site-editor.php</a></li>
<li><a href="#trunksrcwpadminsitehealthinfophp">trunk/src/wp-admin/site-health-info.php</a></li>
<li><a href="#trunksrcwpadminsitehealthphp">trunk/src/wp-admin/site-health.php</a></li>
<li><a href="#trunksrcwpadminthemeeditorphp">trunk/src/wp-admin/theme-editor.php</a></li>
<li><a href="#trunksrcwpadminthemeinstallphp">trunk/src/wp-admin/theme-install.php</a></li>
<li><a href="#trunksrcwpadminthemesphp">trunk/src/wp-admin/themes.php</a></li>
<li><a href="#trunksrcwpadminupdatecorephp">trunk/src/wp-admin/update-core.php</a></li>
<li><a href="#trunksrcwpadminusereditphp">trunk/src/wp-admin/user-edit.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmin_indexphp"></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/_index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/_index.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/_index.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -154,20 +154,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Only show the dashboard notice if it's been less than a minute since the message was postponed.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $time_passed < MINUTE_IN_SECONDS ) :
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
- <div class="notice notice-success is-dismissible">
- <p>
- <?php
- printf(
- /* translators: %s: Human-readable time interval. */
- __( 'The admin email verification page will reappear after %s.' ),
- human_time_diff( time() + $remind_interval )
- );
- ?>
- </p>
- </div>
- <?php endif; ?>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
+ /* translators: %s: Human-readable time interval. */
+ __( 'The admin email verification page will reappear after %s.' ),
+ human_time_diff( time() + $remind_interval )
+ );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ )
+ );
+ endif;
+ endif;
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) :
</span></span></pre></div>
<a id="trunksrcwpadminauthorizeapplicationphp"></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/authorize-application.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/authorize-application.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/authorize-application.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -137,9 +137,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1><?php echo esc_html( $title ); ?></h1>
</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 ( is_wp_error( $error ) ) : ?>
- <div class="notice notice-error"><p><?php echo $error->get_error_message(); ?></p></div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( is_wp_error( $error ) ) {
+ wp_admin_notice(
+ $error->get_error_message(),
+ array(
+ 'type' => 'error',
+ )
+ );
+ }
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="card auth-app-card">
</span><span class="cx" style="display: block; padding: 0 10px"> <h2 class="title"><?php _e( 'An application would like to connect to your account.' ); ?></h2>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,24 +201,25 @@
</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">- <?php if ( $new_password ) : ?>
- <div class="notice notice-success notice-alt below-h2">
- <p class="application-password-display">
- <label for="new-application-password-value">
- <?php
- printf(
- /* translators: %s: Application name. */
- esc_html__( 'Your new password for %s is:' ),
- '<strong>' . esc_html( $app_name ) . '</strong>'
- );
- ?>
- </label>
- <input id="new-application-password-value" type="text" class="code" readonly="readonly" value="<?php esc_attr( WP_Application_Passwords::chunk_password( $new_password ) ); ?>" />
- </p>
- <p><?php _e( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ); ?></p>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( $new_password ) :
+ $message = '<p class="application-password-display">
+ <label for="new-application-password-value">' . sprintf(
+ /* translators: %s: Application name. */
+ esc_html__( 'Your new password for %s is:' ),
+ '<strong>' . esc_html( $app_name ) . '</strong>'
+ ) . '
+ </label>
+ <input id="new-application-password-value" type="text" class="code" readonly="readonly" value="' . esc_attr( WP_Application_Passwords::chunk_password( $new_password ) ) . '" />
+ </p>
+ <p>' . __( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ) . '</p>';
+ $args = array(
+ 'type' => 'success',
+ 'additional_classes' => array( 'notice-alt', 'below-h2' ),
+ 'paragraph_wrap' => false,
+ );
+ wp_admin_notice( $message, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires in the Authorize Application Password new password section in the no-JS version.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,8 +234,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_User $user The user authorizing the application.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'wp_authorize_application_password_form_approved_no_js', $new_password, $request, $user );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ else :
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php else : ?>
</del><span class="cx" style="display: block; padding: 0 10px"> <form action="<?php echo esc_url( admin_url( 'authorize-application.php' ) ); ?>" method="post" class="form-wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_nonce_field( 'authorize_application_password' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <input type="hidden" name="action" value="authorize_application_password" />
</span></span></pre></div>
<a id="trunksrcwpadmincommentphp"></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/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/comment.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/comment.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -161,11 +161,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</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-info"><p>' . $message . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'info',
+ 'id' => 'message',
+ )
+ );
</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">+ wp_admin_notice(
+ '<strong>' . __( 'Caution:' ) . '</strong> ' . $caution_msg,
+ array(
+ 'type' => 'warning',
+ 'id' => 'message',
+ )
+ );
</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 id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>
</del><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <table class="form-table comment-ays">
</span><span class="cx" style="display: block; padding: 0 10px"> <tr>
</span></span></pre></div>
<a id="trunksrcwpadmineditformadvancedphp"></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/edit-form-advanced.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-form-advanced.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/edit-form-advanced.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -440,12 +440,29 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php if ( $notice ) : ?>
-<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice; ?></p></div>
-<?php endif; ?>
-<?php if ( $message ) : ?>
-<div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
-<?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+if ( $notice ) :
+ wp_admin_notice(
+ '<p id="has-newer-autosave">' . $notice . '</p>',
+ array(
+ 'type' => 'warning',
+ 'id' => 'notice',
+ 'paragraph_wrap' => false,
+ )
+ );
+endif;
+if ( $message ) :
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ 'id' => 'message',
+ 'additional_classes' => array( 'updated' ),
+ )
+ );
+endif;
+?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div id="lost-connection-notice" class="error hidden">
</span><span class="cx" style="display: block; padding: 0 10px"> <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you are reconnected.' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="hide-if-no-sessionstorage"><?php _e( 'This post is being backed up in your browser, just in case.' ); ?></span>
</span></span></pre></div>
<a id="trunksrcwpadmineditformblocksphp"></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/edit-form-blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-form-blocks.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/edit-form-blocks.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,27 +319,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php // JavaScript is disabled. ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap hide-if-js block-editor-no-js">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="notice notice-error">
- <p>
- <?php
- $message = sprintf(
- /* translators: %s: A link to install the Classic Editor plugin. */
- __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href="%s">Classic Editor plugin</a>.' ),
- esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) )
- );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ $message = sprintf(
+ /* translators: %s: A link to install the Classic Editor plugin. */
+ __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href="%s">Classic Editor plugin</a>.' ),
+ esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /**
- * Filters the message displayed in the block editor interface when JavaScript is
- * not enabled in the browser.
- *
- * @since 5.0.3
- *
- * @param string $message The message being displayed.
- * @param WP_Post $post The post being edited.
- */
- echo apply_filters( 'block_editor_no_javascript_message', $message, $post );
- ?>
- </p>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * Filters the message displayed in the block editor interface when JavaScript is
+ * not enabled in the browser.
+ *
+ * @since 5.0.3
+ *
+ * @param string $message The message being displayed.
+ * @param WP_Post $post The post being edited.
+ */
+ $message = apply_filters( 'block_editor_no_javascript_message', $message, $post );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ )
+ );
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span></span></pre></div>
<a id="trunksrcwpadminedittagformphp"></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/edit-tag-form.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-tag-form.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/edit-tag-form.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,16 +79,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $class = ( isset( $msg ) && 5 === $msg ) ? 'error' : 'success';
</span><span class="cx" style="display: block; padding: 0 10px">
</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">- ?>
-<div id="message" class="notice notice-<?php echo $class; ?>">
- <p><strong><?php echo $message; ?></strong></p>
- <?php if ( $wp_http_referer ) { ?>
- <p><a href="<?php echo esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>">
- <?php echo esc_html( $tax->labels->back_to_items ); ?>
- </a></p>
- <?php } ?>
-</div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = '<p><strong>' . $message . '</strong></p>';
+ if ( $wp_http_referer ) {
+ $message .= '<p><a href="' . esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ) . '">' . esc_html( $tax->labels->back_to_items ) . '</a></p>';
+ }
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => $class,
+ 'id' => 'message',
+ '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="trunksrcwpadminoptionsprivacyphp"></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/options-privacy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/options-privacy.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/options-privacy.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -177,9 +177,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div class="notice notice-error hide-if-js">
- <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p>
-</div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+wp_admin_notice(
+ __( 'The Privacy Settings require JavaScript.' ),
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'hide-if-js' ),
+ )
+);
+?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="privacy-settings-body hide-if-no-js">
</span><span class="cx" style="display: block; padding: 0 10px"> <h2><?php _e( 'Privacy Settings' ); ?></h2>
</span></span></pre></div>
<a id="trunksrcwpadminoptionsreadingphp"></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/options-reading.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/options-reading.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/options-reading.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,12 +144,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </label></li>
</span><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) : ?>
- <div id="front-page-warning" class="notice notice-warning inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
- <?php endif; ?>
- <?php if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) : ?>
- <div id="privacy-policy-page-warning" class="notice notice-warning inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ); ?></p></div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) :
+ wp_admin_notice(
+ __( '<strong>Warning:</strong> these pages should not be the same!' ),
+ array(
+ 'type' => 'warning',
+ 'id' => 'front-page-warning',
+ 'additional_classes' => array( 'inline' ),
+ )
+ );
+ endif;
+ if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) :
+ wp_admin_notice(
+ __( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ),
+ array(
+ 'type' => 'warning',
+ 'id' => 'privacy-policy-page-warning',
+ 'additional_classes' => array( 'inline' ),
+ )
+ );
+ endif;
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </fieldset></td>
</span><span class="cx" style="display: block; padding: 0 10px"> </tr>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php endif; ?>
</span></span></pre></div>
<a id="trunksrcwpadminoptionsphp"></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/options.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/options.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/options.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,10 +359,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1><?php esc_html_e( 'All Settings' ); ?></h1>
</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="notice notice-warning">
- <p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ); ?></p>
- </div>
-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ wp_admin_notice(
+ '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ),
+ array(
+ 'type' => 'warning',
+ )
+ );
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <form name="form" action="options.php" method="post" id="all-options">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_nonce_field( 'options-options' ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <input type="hidden" name="action" value="update" />
</span></span></pre></div>
<a id="trunksrcwpadminplugineditorphp"></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/plugin-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/plugin-editor.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/plugin-editor.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,16 +182,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1><?php echo esc_html( $title ); ?></h1>
</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 ( isset( $_GET['a'] ) ) : ?>
- <div id="message" class="updated notice is-dismissible">
- <p><?php _e( 'File edited successfully.' ); ?></p>
- </div>
-<?php elseif ( is_wp_error( $edit_error ) ) : ?>
- <div id="message" class="notice notice-error">
- <p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p>
- <pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>
- </div>
-<?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+if ( isset( $_GET['a'] ) ) :
+ wp_admin_notice(
+ __( 'File edited successfully.' ),
+ array(
+ 'additional_classes' => array( 'updated', 'is-dismissible' ),
+ 'id' => 'message',
+ )
+ );
+elseif ( is_wp_error( $edit_error ) ) :
+ $error = esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() );
+ $message = '<p>' . __( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ) . '</p>
+ <pre>' . $error . '</pre>';
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'id' => 'message',
+ 'paragraph_wrap' => false,
+ )
+ );
+endif;
+?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="fileedit-sub">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="alignleft">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -280,11 +293,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php if ( is_writable( $real_file ) ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="editor-notices">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { ?>
- <div class="notice notice-warning inline active-plugin-edit-warning">
- <p><?php _e( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ); ?></p>
- </div>
- <?php } ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) {
+ wp_admin_notice(
+ __( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ),
+ array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'inline', 'active-plugin-edit-warning' ),
+ )
+ );
+ }
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="submit">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>
</span></span></pre></div>
<a id="trunksrcwpadminprivacypolicyguidephp"></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/privacy-policy-guide.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/privacy-policy-guide.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/privacy-policy-guide.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -60,9 +60,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div class="notice notice-error hide-if-js">
- <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p>
-</div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+wp_admin_notice(
+ __( 'The Privacy Settings require JavaScript.' ),
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'hide-if-js' ),
+ )
+);
+?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="privacy-settings-body hide-if-no-js">
</span><span class="cx" style="display: block; padding: 0 10px"> <h2><?php _e( 'Privacy Policy Guide' ); ?></h2>
</span></span></pre></div>
<a id="trunksrcwpadminsiteeditorphp"></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/site-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/site-editor.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/site-editor.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -160,22 +160,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php // JavaScript is disabled. ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap hide-if-js site-editor-no-js">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1 class="wp-heading-inline"><?php _e( 'Edit site' ); ?></h1>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="notice notice-error">
- <p>
- <?php
- /**
- * Filters the message displayed in the site editor interface when JavaScript is
- * not enabled in the browser.
- *
- * @since 6.3.0
- *
- * @param string $message The message being displayed.
- * @param WP_Post $post The post being edited.
- */
- echo apply_filters( 'site_editor_no_javascript_message', __( 'The site editor requires JavaScript. Please enable JavaScript in your browser settings.' ), $post );
- ?>
- </p>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ /**
+ * Filters the message displayed in the site editor interface when JavaScript is
+ * not enabled in the browser.
+ *
+ * @since 6.3.0
+ *
+ * @param string $message The message being displayed.
+ * @param WP_Post $post The post being edited.
+ */
+ $message = apply_filters( 'site_editor_no_javascript_message', __( 'The site editor requires JavaScript. Please enable JavaScript in your browser settings.' ), $post );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'hide-if-js' ),
+ )
+ );
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminsitehealthinfophp"></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/site-health-info.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/site-health-info.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/site-health-info.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -18,12 +18,16 @@
</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"> $health_check_site_status = WP_Site_Health::get_instance();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+wp_admin_notice(
+ __( 'The Site Health check requires JavaScript.' ),
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'hide-if-js' ),
+ )
+);
</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">-<div class="notice notice-error hide-if-js">
- <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
-</div>
-
</del><span class="cx" style="display: block; padding: 0 10px"> <div class="health-check-body health-check-debug-tab hide-if-no-js">
</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="trunksrcwpadminsitehealthphp"></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/site-health.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/site-health.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/site-health.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -105,13 +105,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['https_updated'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $_GET['https_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( 'Site URLs switched to HTTPS.' ); ?></p></div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ __( 'Site URLs switched to HTTPS.' ),
+ array(
+ 'type' => 'success',
+ 'id' => 'message',
+ 'dismissible' => true,
+ )
+ );
</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">- ?>
- <div id="message" class="notice notice-error is-dismissible"><p><?php _e( 'Site URLs could not be switched to HTTPS.' ); ?></p></div>
- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ __( 'Site URLs could not be switched to HTTPS.' ),
+ array(
+ 'type' => 'error',
+ 'id' => 'message',
+ '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 class="lines" style="display: block; padding: 0 10px; color: #888">@@ -212,12 +222,15 @@
</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"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ __( 'The Site Health check requires JavaScript.' ),
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'hide-if-js' ),
+ )
+ );
</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">-<div class="notice notice-error hide-if-js">
- <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>
-</div>
-
</del><span class="cx" style="display: block; padding: 0 10px"> <div class="health-check-body health-check-status-tab hide-if-no-js">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="site-status-all-clear hide">
</span><span class="cx" style="display: block; padding: 0 10px"> <p class="icon">
</span></span></pre></div>
<a id="trunksrcwpadminthemeeditorphp"></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/theme-editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/theme-editor.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/theme-editor.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -189,31 +189,44 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap">
</span><span class="cx" style="display: block; padding: 0 10px"> <h1><?php echo esc_html( $title ); ?></h1>
</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 ( isset( $_GET['a'] ) ) : ?>
- <div id="message" class="updated notice is-dismissible">
- <p><?php _e( 'File edited successfully.' ); ?></p>
- </div>
-<?php elseif ( is_wp_error( $edit_error ) ) : ?>
- <div id="message" class="notice notice-error">
- <p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p>
- <pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>
- </div>
-<?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+if ( isset( $_GET['a'] ) ) {
+ wp_admin_notice(
+ __( 'File edited successfully.' ),
+ array(
+ 'id' => 'message',
+ 'is-dismissible' => true,
+ 'additional_classes' => array( 'updated' ),
+ )
+ );
+} elseif ( is_wp_error( $edit_error ) ) {
+ $error_code = esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() );
+ $message = '<p>' . __( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ) . '</p>
+ <pre>' . $error_code . '</pre>';
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'id' => 'message',
+ )
+ );
+}
</ins><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 ( preg_match( '/\.css$/', $file ) && ! wp_is_block_theme() && current_user_can( 'customize' ) ) : ?>
- <div id="message" class="notice-info notice">
- <p><strong><?php _e( 'Did you know?' ); ?></strong></p>
- <p>
- <?php
- printf(
- /* translators: %s: Link to Custom CSS section in the Customizer. */
- __( 'There is no need to change your CSS here — you can edit and live preview CSS changes in the <a href="%s">built-in CSS editor</a>.' ),
- esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )
- );
- ?>
- </p>
- </div>
-<?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( preg_match( '/\.css$/', $file ) && ! wp_is_block_theme() && current_user_can( 'customize' ) ) {
+ $message = '<p><strong>' . __( 'Did you know?' ) . '</strong></p><p>' . sprintf(
+ /* translators: %s: Link to Custom CSS section in the Customizer. */
+ __( 'There is no need to change your CSS here — you can edit and live preview CSS changes in the <a href="%s">built-in CSS editor</a>.' ),
+ esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )
+ ) . '</p>';
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'info',
+ 'id' => 'message',
+ )
+ );
+}
+?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="fileedit-sub">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="alignleft">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,23 +317,30 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div>
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="editor-notices">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) : ?>
- <div class="notice notice-warning inline">
- <p>
- <?php if ( is_writable( $file ) ) : ?>
- <strong><?php _e( 'Caution:' ); ?></strong>
- <?php endif; ?>
- <?php _e( 'This is a file in your current parent theme.' ); ?>
- </p>
- </div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) :
+ $message = ( is_writable( $file ) ) ? '<strong>' . __( 'Caution:' ) . '</strong> ' : '';
+ $message .= __( 'This is a file in your current parent theme.' );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'inline' ),
+ )
+ );
+ endif;
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( is_writable( $file ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( is_writable( $file ) ) {
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <p class="submit">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="spinner"></span>
</span><span class="cx" style="display: block; padding: 0 10px"> </p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php else : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ } else {
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <p>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> printf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -330,7 +350,9 @@
</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"> </p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ }
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php wp_print_file_editor_templates(); ?>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -342,7 +364,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Get a back URL.
</span><span class="cx" style="display: block; padding: 0 10px"> $referer = wp_get_referer();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -388,6 +410,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-endif; // Editor warning notice.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+} // Editor warning notice.
</ins><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-footer.php';
</span></span></pre></div>
<a id="trunksrcwpadminthemeinstallphp"></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/theme-install.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/theme-install.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/theme-install.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -318,7 +318,15 @@
</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 ( data.installed ) { #>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ wp_admin_notice(
+ _x( 'Installed', 'theme' ),
+ array(
+ 'type' => 'success',
+ 'additional_classes' => array( 'notice-alt' ),
+ )
+ );
+ ?>
</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 ( ! data.compatible_wp || ! data.compatible_php ) { #>
</span></span></pre></div>
<a id="trunksrcwpadminthemesphp"></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/themes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/themes.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/themes.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -469,35 +469,35 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="notice inline notice-error notice-alt"><p>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _e( 'This theme does not work with your versions of WordPress and PHP.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = __( 'This theme 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">+ $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">+ $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">+ $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">+ $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">+ $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 ( ! $theme['compatibleWP'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _e( 'This theme does not work with your version of WordPress.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message .= __( 'This theme 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">+ $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">@@ -504,17 +504,24 @@
</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 ( ! $theme['compatiblePHP'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _e( 'This theme does not work with your version of PHP.' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message .= __( 'This theme 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">+ $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">+ $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><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'inline', 'notice-alt' ),
+ )
+ );
</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">@@ -692,6 +699,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string The template for displaying the auto-update setting link.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_theme_auto_update_setting_template() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $notice = wp_get_admin_notice(
+ '',
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> $template = '
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="theme-autoupdate">
</span><span class="cx" style="display: block; padding: 0 10px"> <# if ( data.autoupdate.supported ) { #>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -717,7 +731,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <# } #>
</span><span class="cx" style="display: block; padding: 0 10px"> <br />' . wp_get_auto_update_message() . '</span>
</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="notice notice-error notice-alt inline hidden"><p></p></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ' . $notice . '
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</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="trunksrcwpadminupdatecorephp"></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/update-core.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/update-core.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/update-core.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -255,14 +255,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> _e( 'An updated version of WordPress is available.' );
</span><span class="cx" style="display: block; padding: 0 10px"> echo '</h2>';
</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-warning inline"><p>';
- printf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $message = sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( '<strong>Important:</strong> Before updating, please <a href="%1$s">back up your database and files</a>. For help with updates, visit the <a href="%2$s">Updating WordPress</a> documentation page.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'https://wordpress.org/documentation/article/wordpress-backups/' ),
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'https://wordpress.org/documentation/article/updating-wordpress/' )
</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>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'warning',
+ 'additional_classes' => array( 'inline' ),
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $is_development_version ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<h2 class="response">' . __( 'You are using a development version of WordPress.' ) . '</h2>';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -302,10 +307,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_GET['core-major-auto-updates-saved'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'enabled' === $_GET['core-major-auto-updates-saved'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $notice_text,
+ array(
+ 'type' => 'success',
+ 'dismissible' => true,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( 'disabled' === $_GET['core-major-auto-updates-saved'] ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $notice_text = __( 'WordPress will only receive automatic security and maintenance releases from now on.' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_admin_notice(
+ $notice_text,
+ array(
+ 'type' => 'success',
+ '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="trunksrcwpadminusereditphp"></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/user-edit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/user-edit.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-admin/user-edit.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,36 +200,57 @@
</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">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php if ( ! IS_PROFILE_PAGE && is_super_admin( $profile_user->ID ) && current_user_can( 'manage_network_options' ) ) : ?>
- <div class="notice notice-info"><p><strong><?php _e( 'Important:' ); ?></strong> <?php _e( 'This user has super admin privileges.' ); ?></p></div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ if ( ! IS_PROFILE_PAGE && is_super_admin( $profile_user->ID ) && current_user_can( 'manage_network_options' ) ) :
+ $message = '<strong>' . __( 'Important:' ) . '</strong> ' . __( 'This user has super admin privileges.' );
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'info',
+ )
+ );
+ endif;
</ins><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 ( isset( $_GET['updated'] ) ) : ?>
- <div id="message" class="updated notice is-dismissible">
- <?php if ( IS_PROFILE_PAGE ) : ?>
- <p><strong><?php _e( 'Profile updated.' ); ?></strong></p>
- <?php else : ?>
- <p><strong><?php _e( 'User updated.' ); ?></strong></p>
- <?php endif; ?>
- <?php if ( $wp_http_referer && ! str_contains( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?>
- <p><a href="<?php echo esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), self_admin_url( 'users.php' ) ) ); ?>"><?php _e( '← Go to Users' ); ?></a></p>
- <?php endif; ?>
- </div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $_GET['updated'] ) ) :
+ if ( IS_PROFILE_PAGE ) :
+ $message = '<strong>' . __( 'Profile updated.' ) . '</strong>';
+ else :
+ $message = '<strong>' . __( 'User updated.' ) . '</strong>';
+ endif;
+ if ( $wp_http_referer && ! str_contains( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) :
+ $message .= '<a href="' . esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), self_admin_url( 'users.php' ) ) ) . '">' . __( '← Go to Users' ) . '</a>';
+ endif;
+ wp_admin_notice(
+ $message,
+ array(
+ 'id' => 'message',
+ 'dismissible' => true,
+ 'additional_classes' => array( 'updated' ),
+ )
+ );
+ endif;
</ins><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 ( isset( $_GET['error'] ) ) : ?>
- <div class="notice notice-error">
- <?php if ( 'new-email' === $_GET['error'] ) : ?>
- <p><?php _e( 'Error while saving the new email address. Please try again.' ); ?></p>
- <?php endif; ?>
- </div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $_GET['error'] ) ) :
+ $message = '';
+ if ( 'new-email' === $_GET['error'] ) :
+ $message = __( 'Error while saving the new email address. Please try again.' );
+ endif;
+ wp_admin_notice(
+ $message,
+ array(
+ 'type' => 'error',
+ )
+ );
+ endif;
</ins><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 ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $errors ) && is_wp_error( $errors ) ) {
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px"> <div class="error">
</span><span class="cx" style="display: block; padding: 0 10px"> <p><?php echo implode( "</p>\n<p>", $errors->get_error_messages() ); ?></p>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ }
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="wrap" id="profile-page">
</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">@@ -802,11 +823,17 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <button type="button" name="do_new_application_password" id="do_new_application_password" class="button button-secondary"><?php _e( 'Add New Application Password' ); ?></button>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php else : ?>
- <div class="notice notice-error inline">
- <p><?php _e( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ); ?></p>
- </div>
- <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php
+ else :
+ wp_admin_notice(
+ __( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ),
+ array(
+ 'type' => 'error',
+ 'additional_classes' => array( 'inline' ),
+ )
+ );
+ endif;
+ ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="application-passwords-list-table-wrapper">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2023-09-13 22:14:15 UTC (rev 56569)
+++ trunk/src/wp-includes/functions.php 2023-09-14 00:52:45 UTC (rev 56570)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -8318,15 +8318,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 5.2.0 Added the `$before` and `$after` parameters.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 6.4.0 Added the `$echo` parameter.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $before Markup to output before the annotation. Default `<p class="description">`.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $after Markup to output after the annotation. Default `</p>`.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $echo Markup should echo if true. Default `true`.
+ *
+ * @return string|void
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wp_update_php_annotation( $before = '<p class="description">', $after = '</p>' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function wp_update_php_annotation( $before = '<p class="description">', $after = '</p>', $echo = true ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $annotation = wp_get_update_php_annotation();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $annotation ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo $before . $annotation . $after;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $echo ) {
+ echo $before . $annotation . $after;
+ } else {
+ return $before . $annotation . $after;
+ }
</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>