Changeset 56570
- Timestamp:
- 09/14/2023 12:52:45 AM (14 months ago)
- Location:
- trunk/src
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/_index.php
r55917 r56570 155 155 // Only show the dashboard notice if it's been less than a minute since the message was postponed. 156 156 if ( $time_passed < MINUTE_IN_SECONDS ) : 157 ?> 158 <div class="notice notice-success is-dismissible"> 159 <p> 160 <?php 161 printf( 162 /* translators: %s: Human-readable time interval. */ 163 __( 'The admin email verification page will reappear after %s.' ), 164 human_time_diff( time() + $remind_interval ) 165 ); 166 ?> 167 </p> 168 </div> 169 <?php endif; ?> 170 <?php endif; ?> 157 $message = sprintf( 158 /* translators: %s: Human-readable time interval. */ 159 __( 'The admin email verification page will reappear after %s.' ), 160 human_time_diff( time() + $remind_interval ) 161 ); 162 wp_admin_notice( 163 $message, 164 array( 165 'type' => 'success', 166 'dismissible' => true, 167 ) 168 ); 169 endif; 170 endif; 171 ?> 171 172 172 173 <?php -
trunk/src/wp-admin/authorize-application.php
r53827 r56570 138 138 <h1><?php echo esc_html( $title ); ?></h1> 139 139 140 <?php if ( is_wp_error( $error ) ) : ?> 141 <div class="notice notice-error"><p><?php echo $error->get_error_message(); ?></p></div> 142 <?php endif; ?> 140 <?php 141 if ( is_wp_error( $error ) ) { 142 wp_admin_notice( 143 $error->get_error_message(), 144 array( 145 'type' => 'error', 146 ) 147 ); 148 } 149 ?> 143 150 144 151 <div class="card auth-app-card"> … … 195 202 ?> 196 203 197 <?php if ( $new_password ) : ?> 198 <div class="notice notice-success notice-alt below-h2"> 199 <p class="application-password-display"> 200 <label for="new-application-password-value"> 201 <?php 202 printf( 203 /* translators: %s: Application name. */ 204 esc_html__( 'Your new password for %s is:' ), 205 '<strong>' . esc_html( $app_name ) . '</strong>' 206 ); 207 ?> 208 </label> 209 <input id="new-application-password-value" type="text" class="code" readonly="readonly" value="<?php esc_attr( WP_Application_Passwords::chunk_password( $new_password ) ); ?>" /> 210 </p> 211 <p><?php _e( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ); ?></p> 212 </div> 213 214 <?php 204 <?php 205 if ( $new_password ) : 206 $message = '<p class="application-password-display"> 207 <label for="new-application-password-value">' . sprintf( 208 /* translators: %s: Application name. */ 209 esc_html__( 'Your new password for %s is:' ), 210 '<strong>' . esc_html( $app_name ) . '</strong>' 211 ) . ' 212 </label> 213 <input id="new-application-password-value" type="text" class="code" readonly="readonly" value="' . esc_attr( WP_Application_Passwords::chunk_password( $new_password ) ) . '" /> 214 </p> 215 <p>' . __( 'Be sure to save this in a safe location. You will not be able to retrieve it.' ) . '</p>'; 216 $args = array( 217 'type' => 'success', 218 'additional_classes' => array( 'notice-alt', 'below-h2' ), 219 'paragraph_wrap' => false, 220 ); 221 wp_admin_notice( $message, $args ); 222 215 223 /** 216 224 * Fires in the Authorize Application Password new password section in the no-JS version. … … 227 235 */ 228 236 do_action( 'wp_authorize_application_password_form_approved_no_js', $new_password, $request, $user ); 237 else : 229 238 ?> 230 <?php else : ?>231 239 <form action="<?php echo esc_url( admin_url( 'authorize-application.php' ) ); ?>" method="post" class="form-wrap"> 232 240 <?php wp_nonce_field( 'authorize_application_password' ); ?> -
trunk/src/wp-admin/comment.php
r55988 r56570 162 162 } 163 163 if ( $message ) { 164 echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>'; 164 wp_admin_notice( 165 $message, 166 array( 167 'type' => 'info', 168 'id' => 'message', 169 ) 170 ); 165 171 } 166 172 } 173 wp_admin_notice( 174 '<strong>' . __( 'Caution:' ) . '</strong> ' . $caution_msg, 175 array( 176 'type' => 'warning', 177 'id' => 'message', 178 ) 179 ); 167 180 ?> 168 <div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>169 181 170 182 <table class="form-table comment-ays"> -
trunk/src/wp-admin/edit-form-advanced.php
r55414 r56570 441 441 <hr class="wp-header-end"> 442 442 443 <?php if ( $notice ) : ?> 444 <div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice; ?></p></div> 445 <?php endif; ?> 446 <?php if ( $message ) : ?> 447 <div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div> 448 <?php endif; ?> 443 <?php 444 if ( $notice ) : 445 wp_admin_notice( 446 '<p id="has-newer-autosave">' . $notice . '</p>', 447 array( 448 'type' => 'warning', 449 'id' => 'notice', 450 'paragraph_wrap' => false, 451 ) 452 ); 453 endif; 454 if ( $message ) : 455 wp_admin_notice( 456 $message, 457 array( 458 'type' => 'success', 459 'dismissible' => true, 460 'id' => 'message', 461 'additional_classes' => array( 'updated' ), 462 ) 463 ); 464 endif; 465 ?> 449 466 <div id="lost-connection-notice" class="error hidden"> 450 467 <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you are reconnected.' ); ?> -
trunk/src/wp-admin/edit-form-blocks.php
r56559 r56570 320 320 <div class="wrap hide-if-js block-editor-no-js"> 321 321 <h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1> 322 <div class="notice notice-error"> 323 <p> 324 <?php 325 $message = sprintf( 326 /* translators: %s: A link to install the Classic Editor plugin. */ 327 __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href="%s">Classic Editor plugin</a>.' ), 328 esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) ) 329 ); 330 331 /** 332 * Filters the message displayed in the block editor interface when JavaScript is 333 * not enabled in the browser. 334 * 335 * @since 5.0.3 336 * 337 * @param string $message The message being displayed. 338 * @param WP_Post $post The post being edited. 339 */ 340 echo apply_filters( 'block_editor_no_javascript_message', $message, $post ); 341 ?> 342 </p> 343 </div> 322 <?php 323 $message = sprintf( 324 /* translators: %s: A link to install the Classic Editor plugin. */ 325 __( 'The block editor requires JavaScript. Please enable JavaScript in your browser settings, or try the <a href="%s">Classic Editor plugin</a>.' ), 326 esc_url( wp_nonce_url( self_admin_url( 'plugin-install.php?tab=favorites&user=wordpressdotorg&save=0' ), 'save_wporg_username_' . get_current_user_id() ) ) 327 ); 328 329 /** 330 * Filters the message displayed in the block editor interface when JavaScript is 331 * not enabled in the browser. 332 * 333 * @since 5.0.3 334 * 335 * @param string $message The message being displayed. 336 * @param WP_Post $post The post being edited. 337 */ 338 $message = apply_filters( 'block_editor_no_javascript_message', $message, $post ); 339 wp_admin_notice( 340 $message, 341 array( 342 'type' => 'error', 343 ) 344 ); 345 ?> 344 346 </div> 345 347 </div> -
trunk/src/wp-admin/edit-tag-form.php
r54240 r56570 80 80 81 81 if ( $message ) { 82 ?> 83 <div id="message" class="notice notice-<?php echo $class; ?>"> 84 <p><strong><?php echo $message; ?></strong></p> 85 <?php if ( $wp_http_referer ) { ?> 86 <p><a href="<?php echo esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>"> 87 <?php echo esc_html( $tax->labels->back_to_items ); ?> 88 </a></p> 89 <?php } ?> 90 </div> 91 <?php 82 $message = '<p><strong>' . $message . '</strong></p>'; 83 if ( $wp_http_referer ) { 84 $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>'; 85 } 86 wp_admin_notice( 87 $message, 88 array( 89 'type' => $class, 90 'id' => 'message', 91 'paragraph_wrap' => false, 92 ) 93 ); 92 94 } 93 95 ?> -
trunk/src/wp-admin/options-privacy.php
r56559 r56570 178 178 <hr class="wp-header-end"> 179 179 180 <div class="notice notice-error hide-if-js"> 181 <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p> 182 </div> 180 <?php 181 wp_admin_notice( 182 __( 'The Privacy Settings require JavaScript.' ), 183 array( 184 'type' => 'error', 185 'additional_classes' => array( 'hide-if-js' ), 186 ) 187 ); 188 ?> 183 189 184 190 <div class="privacy-settings-body hide-if-no-js"> -
trunk/src/wp-admin/options-reading.php
r55412 r56570 145 145 </label></li> 146 146 </ul> 147 <?php if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) : ?> 148 <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> 149 <?php endif; ?> 150 <?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' ) ) : ?> 151 <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> 152 <?php endif; ?> 147 <?php 148 if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) : 149 wp_admin_notice( 150 __( '<strong>Warning:</strong> these pages should not be the same!' ), 151 array( 152 'type' => 'warning', 153 'id' => 'front-page-warning', 154 'additional_classes' => array( 'inline' ), 155 ) 156 ); 157 endif; 158 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' ) ) : 159 wp_admin_notice( 160 __( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ), 161 array( 162 'type' => 'warning', 163 'id' => 'privacy-policy-page-warning', 164 'additional_classes' => array( 'inline' ), 165 ) 166 ); 167 endif; 168 ?> 153 169 </fieldset></td> 154 170 </tr> -
trunk/src/wp-admin/options.php
r55988 r56570 360 360 <h1><?php esc_html_e( 'All Settings' ); ?></h1> 361 361 362 <div class="notice notice-warning"> 363 <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> 364 </div> 365 362 <?php 363 wp_admin_notice( 364 '<strong>' . __( 'Warning:' ) . '</strong> ' . __( 'This page allows direct access to your site settings. You can break things here. Please be cautious!' ), 365 array( 366 'type' => 'warning', 367 ) 368 ); 369 ?> 366 370 <form name="form" action="options.php" method="post" id="all-options"> 367 371 <?php wp_nonce_field( 'options-options' ); ?> -
trunk/src/wp-admin/plugin-editor.php
r56014 r56570 183 183 <h1><?php echo esc_html( $title ); ?></h1> 184 184 185 <?php if ( isset( $_GET['a'] ) ) : ?> 186 <div id="message" class="updated notice is-dismissible"> 187 <p><?php _e( 'File edited successfully.' ); ?></p> 188 </div> 189 <?php elseif ( is_wp_error( $edit_error ) ) : ?> 190 <div id="message" class="notice notice-error"> 191 <p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p> 192 <pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre> 193 </div> 194 <?php endif; ?> 185 <?php 186 if ( isset( $_GET['a'] ) ) : 187 wp_admin_notice( 188 __( 'File edited successfully.' ), 189 array( 190 'additional_classes' => array( 'updated', 'is-dismissible' ), 191 'id' => 'message', 192 ) 193 ); 194 elseif ( is_wp_error( $edit_error ) ) : 195 $error = esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); 196 $message = '<p>' . __( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ) . '</p> 197 <pre>' . $error . '</pre>'; 198 wp_admin_notice( 199 $message, 200 array( 201 'type' => 'error', 202 'id' => 'message', 203 'paragraph_wrap' => false, 204 ) 205 ); 206 endif; 207 ?> 195 208 196 209 <div class="fileedit-sub"> … … 281 294 <?php if ( is_writable( $real_file ) ) : ?> 282 295 <div class="editor-notices"> 283 <?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { ?> 284 <div class="notice notice-warning inline active-plugin-edit-warning"> 285 <p><?php _e( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ); ?></p> 286 </div> 287 <?php } ?> 296 <?php 297 if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ), true ) ) { 298 wp_admin_notice( 299 __( '<strong>Warning:</strong> Making changes to active plugins is not recommended.' ), 300 array( 301 'type' => 'warning', 302 'additional_classes' => array( 'inline', 'active-plugin-edit-warning' ), 303 ) 304 ); 305 } 306 ?> 288 307 </div> 289 308 <p class="submit"> -
trunk/src/wp-admin/privacy-policy-guide.php
r56559 r56570 61 61 <hr class="wp-header-end"> 62 62 63 <div class="notice notice-error hide-if-js"> 64 <p><?php _e( 'The Privacy Settings require JavaScript.' ); ?></p> 65 </div> 63 <?php 64 wp_admin_notice( 65 __( 'The Privacy Settings require JavaScript.' ), 66 array( 67 'type' => 'error', 68 'additional_classes' => array( 'hide-if-js' ), 69 ) 70 ); 71 ?> 66 72 67 73 <div class="privacy-settings-body hide-if-no-js"> -
trunk/src/wp-admin/site-editor.php
r56559 r56570 161 161 <div class="wrap hide-if-js site-editor-no-js"> 162 162 <h1 class="wp-heading-inline"><?php _e( 'Edit site' ); ?></h1> 163 <div class="notice notice-error"> 164 <p> 165 <?php 166 /** 167 * Filters the message displayed in the site editor interface when JavaScript is 168 * not enabled in the browser. 169 * 170 * @since 6.3.0 171 * 172 * @param string $message The message being displayed. 173 * @param WP_Post $post The post being edited. 174 */ 175 echo apply_filters( 'site_editor_no_javascript_message', __( 'The site editor requires JavaScript. Please enable JavaScript in your browser settings.' ), $post ); 176 ?> 177 </p> 178 </div> 163 <?php 164 /** 165 * Filters the message displayed in the site editor interface when JavaScript is 166 * not enabled in the browser. 167 * 168 * @since 6.3.0 169 * 170 * @param string $message The message being displayed. 171 * @param WP_Post $post The post being edited. 172 */ 173 $message = apply_filters( 'site_editor_no_javascript_message', __( 'The site editor requires JavaScript. Please enable JavaScript in your browser settings.' ), $post ); 174 wp_admin_notice( 175 $message, 176 array( 177 'type' => 'error', 178 'additional_classes' => array( 'hide-if-js' ), 179 ) 180 ); 181 ?> 179 182 </div> 180 183 </div> -
trunk/src/wp-admin/site-health-info.php
r51970 r56570 19 19 20 20 $health_check_site_status = WP_Site_Health::get_instance(); 21 22 wp_admin_notice( 23 __( 'The Site Health check requires JavaScript.' ), 24 array( 25 'type' => 'error', 26 'additional_classes' => array( 'hide-if-js' ), 27 ) 28 ); 21 29 ?> 22 23 <div class="notice notice-error hide-if-js">24 <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>25 </div>26 30 27 31 <div class="health-check-body health-check-debug-tab hide-if-no-js"> -
trunk/src/wp-admin/site-health.php
r55917 r56570 106 106 if ( isset( $_GET['https_updated'] ) ) { 107 107 if ( $_GET['https_updated'] ) { 108 ?> 109 <div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Site URLs switched to HTTPS.' ); ?></p></div> 110 <?php 108 wp_admin_notice( 109 __( 'Site URLs switched to HTTPS.' ), 110 array( 111 'type' => 'success', 112 'id' => 'message', 113 'dismissible' => true, 114 ) 115 ); 111 116 } else { 112 ?> 113 <div id="message" class="notice notice-error is-dismissible"><p><?php _e( 'Site URLs could not be switched to HTTPS.' ); ?></p></div> 114 <?php 117 wp_admin_notice( 118 __( 'Site URLs could not be switched to HTTPS.' ), 119 array( 120 'type' => 'error', 121 'id' => 'message', 122 'dismissible' => true, 123 ) 124 ); 115 125 } 116 126 } … … 213 223 return; 214 224 } else { 225 wp_admin_notice( 226 __( 'The Site Health check requires JavaScript.' ), 227 array( 228 'type' => 'error', 229 'additional_classes' => array( 'hide-if-js' ), 230 ) 231 ); 215 232 ?> 216 217 <div class="notice notice-error hide-if-js">218 <p><?php _e( 'The Site Health check requires JavaScript.' ); ?></p>219 </div>220 233 221 234 <div class="health-check-body health-check-status-tab hide-if-no-js"> -
trunk/src/wp-admin/theme-editor.php
r56014 r56570 190 190 <h1><?php echo esc_html( $title ); ?></h1> 191 191 192 <?php if ( isset( $_GET['a'] ) ) : ?> 193 <div id="message" class="updated notice is-dismissible"> 194 <p><?php _e( 'File edited successfully.' ); ?></p> 195 </div> 196 <?php elseif ( is_wp_error( $edit_error ) ) : ?> 197 <div id="message" class="notice notice-error"> 198 <p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p> 199 <pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre> 200 </div> 201 <?php endif; ?> 202 203 <?php if ( preg_match( '/\.css$/', $file ) && ! wp_is_block_theme() && current_user_can( 'customize' ) ) : ?> 204 <div id="message" class="notice-info notice"> 205 <p><strong><?php _e( 'Did you know?' ); ?></strong></p> 206 <p> 207 <?php 208 printf( 209 /* translators: %s: Link to Custom CSS section in the Customizer. */ 210 __( '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>.' ), 211 esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) ) 212 ); 213 ?> 214 </p> 215 </div> 216 <?php endif; ?> 192 <?php 193 if ( isset( $_GET['a'] ) ) { 194 wp_admin_notice( 195 __( 'File edited successfully.' ), 196 array( 197 'id' => 'message', 198 'is-dismissible' => true, 199 'additional_classes' => array( 'updated' ), 200 ) 201 ); 202 } elseif ( is_wp_error( $edit_error ) ) { 203 $error_code = esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); 204 $message = '<p>' . __( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ) . '</p> 205 <pre>' . $error_code . '</pre>'; 206 wp_admin_notice( 207 $message, 208 array( 209 'type' => 'error', 210 'id' => 'message', 211 ) 212 ); 213 } 214 215 if ( preg_match( '/\.css$/', $file ) && ! wp_is_block_theme() && current_user_can( 'customize' ) ) { 216 $message = '<p><strong>' . __( 'Did you know?' ) . '</strong></p><p>' . sprintf( 217 /* translators: %s: Link to Custom CSS section in the Customizer. */ 218 __( '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>.' ), 219 esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) ) 220 ) . '</p>'; 221 wp_admin_notice( 222 $message, 223 array( 224 'type' => 'info', 225 'id' => 'message', 226 ) 227 ); 228 } 229 ?> 217 230 218 231 <div class="fileedit-sub"> … … 305 318 <div> 306 319 <div class="editor-notices"> 307 <?php if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) : ?> 308 <div class="notice notice-warning inline"> 309 <p> 310 <?php if ( is_writable( $file ) ) : ?> 311 <strong><?php _e( 'Caution:' ); ?></strong> 312 <?php endif; ?> 313 <?php _e( 'This is a file in your current parent theme.' ); ?> 314 </p> 315 </div> 316 <?php endif; ?> 320 <?php 321 if ( is_child_theme() && $theme->get_stylesheet() === get_template() ) : 322 $message = ( is_writable( $file ) ) ? '<strong>' . __( 'Caution:' ) . '</strong> ' : ''; 323 $message .= __( 'This is a file in your current parent theme.' ); 324 wp_admin_notice( 325 $message, 326 array( 327 'type' => 'warning', 328 'additional_classes' => array( 'inline' ), 329 ) 330 ); 331 endif; 332 ?> 317 333 </div> 318 <?php if ( is_writable( $file ) ) : ?> 334 <?php 335 if ( is_writable( $file ) ) { 336 ?> 319 337 <p class="submit"> 320 338 <?php submit_button( __( 'Update File' ), 'primary', 'submit', false ); ?> 321 339 <span class="spinner"></span> 322 340 </p> 323 <?php else : ?> 341 <?php 342 } else { 343 ?> 324 344 <p> 325 345 <?php … … 331 351 ?> 332 352 </p> 333 <?php endif; ?> 353 <?php 354 } 355 ?> 334 356 </div> 335 357 … … 343 365 <?php 344 366 $dismissed_pointers = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ); 345 if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :367 if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) { 346 368 // Get a back URL. 347 369 $referer = wp_get_referer(); … … 389 411 </div> 390 412 <?php 391 endif;// Editor warning notice.413 } // Editor warning notice. 392 414 393 415 require_once ABSPATH . 'wp-admin/admin-footer.php'; -
trunk/src/wp-admin/theme-install.php
r55412 r56570 319 319 320 320 <# if ( data.installed ) { #> 321 <div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div> 321 <?php 322 wp_admin_notice( 323 _x( 'Installed', 'theme' ), 324 array( 325 'type' => 'success', 326 'additional_classes' => array( 'notice-alt' ), 327 ) 328 ); 329 ?> 322 330 <# } #> 323 331 -
trunk/src/wp-admin/themes.php
r56515 r56570 470 470 <?php 471 471 if ( ! $theme['compatibleWP'] || ! $theme['compatiblePHP'] ) { 472 echo '<div class="notice inline notice-error notice-alt"><p>';472 $message = ''; 473 473 if ( ! $theme['compatibleWP'] && ! $theme['compatiblePHP'] ) { 474 _e( 'This theme does not work with your versions of WordPress and PHP.' );474 $message = __( 'This theme does not work with your versions of WordPress and PHP.' ); 475 475 if ( current_user_can( 'update_core' ) && current_user_can( 'update_php' ) ) { 476 printf(476 $message .= sprintf( 477 477 /* translators: 1: URL to WordPress Updates screen, 2: URL to Update PHP page. */ 478 478 ' ' . __( '<a href="%1$s">Please update WordPress</a>, and then <a href="%2$s">learn more about updating PHP</a>.' ), … … 480 480 esc_url( wp_get_update_php_url() ) 481 481 ); 482 wp_update_php_annotation( '</p><p><em>', '</em>');482 $message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); 483 483 } elseif ( current_user_can( 'update_core' ) ) { 484 printf(484 $message .= sprintf( 485 485 /* translators: %s: URL to WordPress Updates screen. */ 486 486 ' ' . __( '<a href="%s">Please update WordPress</a>.' ), … … 488 488 ); 489 489 } elseif ( current_user_can( 'update_php' ) ) { 490 printf(490 $message .= sprintf( 491 491 /* translators: %s: URL to Update PHP page. */ 492 492 ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), 493 493 esc_url( wp_get_update_php_url() ) 494 494 ); 495 wp_update_php_annotation( '</p><p><em>', '</em>');495 $message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); 496 496 } 497 497 } elseif ( ! $theme['compatibleWP'] ) { 498 _e( 'This theme does not work with your version of WordPress.' );498 $message .= __( 'This theme does not work with your version of WordPress.' ); 499 499 if ( current_user_can( 'update_core' ) ) { 500 printf(500 $message .= sprintf( 501 501 /* translators: %s: URL to WordPress Updates screen. */ 502 502 ' ' . __( '<a href="%s">Please update WordPress</a>.' ), … … 505 505 } 506 506 } elseif ( ! $theme['compatiblePHP'] ) { 507 _e( 'This theme does not work with your version of PHP.' );507 $message .= __( 'This theme does not work with your version of PHP.' ); 508 508 if ( current_user_can( 'update_php' ) ) { 509 printf(509 $message .= sprintf( 510 510 /* translators: %s: URL to Update PHP page. */ 511 511 ' ' . __( '<a href="%s">Learn more about updating PHP</a>.' ), 512 512 esc_url( wp_get_update_php_url() ) 513 513 ); 514 wp_update_php_annotation( '</p><p><em>', '</em>');514 $message .= wp_update_php_annotation( '</p><p><em>', '</em>', false ); 515 515 } 516 516 } 517 echo '</p></div>'; 517 518 wp_admin_notice( 519 $message, 520 array( 521 'type' => 'error', 522 'additional_classes' => array( 'inline', 'notice-alt' ), 523 ) 524 ); 518 525 } 519 526 ?> … … 693 700 */ 694 701 function wp_theme_auto_update_setting_template() { 702 $notice = wp_get_admin_notice( 703 '', 704 array( 705 'type' => 'error', 706 'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), 707 ) 708 ); 695 709 $template = ' 696 710 <div class="theme-autoupdate"> … … 718 732 <br />' . wp_get_auto_update_message() . '</span> 719 733 <# } #> 720 <div class="notice notice-error notice-alt inline hidden"><p></p></div>734 ' . $notice . ' 721 735 </div> 722 736 '; -
trunk/src/wp-admin/update-core.php
r56548 r56570 256 256 echo '</h2>'; 257 257 258 echo '<div class="notice notice-warning inline"><p>'; 259 printf( 258 $message = sprintf( 260 259 /* translators: 1: Documentation on WordPress backups, 2: Documentation on updating WordPress. */ 261 260 __( '<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.' ), … … 263 262 __( 'https://wordpress.org/documentation/article/updating-wordpress/' ) 264 263 ); 265 echo '</p></div>'; 264 wp_admin_notice( 265 $message, 266 array( 267 'type' => 'warning', 268 'additional_classes' => array( 'inline' ), 269 ) 270 ); 266 271 } elseif ( $is_development_version ) { 267 272 echo '<h2 class="response">' . __( 'You are using a development version of WordPress.' ) . '</h2>'; … … 303 308 if ( 'enabled' === $_GET['core-major-auto-updates-saved'] ) { 304 309 $notice_text = __( 'Automatic updates for all WordPress versions have been enabled. Thank you!' ); 305 echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>'; 310 wp_admin_notice( 311 $notice_text, 312 array( 313 'type' => 'success', 314 'dismissible' => true, 315 ) 316 ); 306 317 } elseif ( 'disabled' === $_GET['core-major-auto-updates-saved'] ) { 307 318 $notice_text = __( 'WordPress will only receive automatic security and maintenance releases from now on.' ); 308 echo '<div class="notice notice-success is-dismissible"><p>' . $notice_text . '</p></div>'; 319 wp_admin_notice( 320 $notice_text, 321 array( 322 'type' => 'success', 323 'dismissible' => true, 324 ) 325 ); 309 326 } 310 327 } -
trunk/src/wp-admin/user-edit.php
r56515 r56570 201 201 ?> 202 202 203 <?php if ( ! IS_PROFILE_PAGE && is_super_admin( $profile_user->ID ) && current_user_can( 'manage_network_options' ) ) : ?> 204 <div class="notice notice-info"><p><strong><?php _e( 'Important:' ); ?></strong> <?php _e( 'This user has super admin privileges.' ); ?></p></div> 205 <?php endif; ?> 206 207 <?php if ( isset( $_GET['updated'] ) ) : ?> 208 <div id="message" class="updated notice is-dismissible"> 209 <?php if ( IS_PROFILE_PAGE ) : ?> 210 <p><strong><?php _e( 'Profile updated.' ); ?></strong></p> 211 <?php else : ?> 212 <p><strong><?php _e( 'User updated.' ); ?></strong></p> 213 <?php endif; ?> 214 <?php if ( $wp_http_referer && ! str_contains( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : ?> 215 <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> 216 <?php endif; ?> 217 </div> 218 <?php endif; ?> 219 220 <?php if ( isset( $_GET['error'] ) ) : ?> 221 <div class="notice notice-error"> 222 <?php if ( 'new-email' === $_GET['error'] ) : ?> 223 <p><?php _e( 'Error while saving the new email address. Please try again.' ); ?></p> 224 <?php endif; ?> 225 </div> 226 <?php endif; ?> 227 228 <?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?> 203 <?php 204 if ( ! IS_PROFILE_PAGE && is_super_admin( $profile_user->ID ) && current_user_can( 'manage_network_options' ) ) : 205 $message = '<strong>' . __( 'Important:' ) . '</strong> ' . __( 'This user has super admin privileges.' ); 206 wp_admin_notice( 207 $message, 208 array( 209 'type' => 'info', 210 ) 211 ); 212 endif; 213 214 if ( isset( $_GET['updated'] ) ) : 215 if ( IS_PROFILE_PAGE ) : 216 $message = '<strong>' . __( 'Profile updated.' ) . '</strong>'; 217 else : 218 $message = '<strong>' . __( 'User updated.' ) . '</strong>'; 219 endif; 220 if ( $wp_http_referer && ! str_contains( $wp_http_referer, 'user-new.php' ) && ! IS_PROFILE_PAGE ) : 221 $message .= '<a href="' . esc_url( wp_validate_redirect( sanitize_url( $wp_http_referer ), self_admin_url( 'users.php' ) ) ) . '">' . __( '← Go to Users' ) . '</a>'; 222 endif; 223 wp_admin_notice( 224 $message, 225 array( 226 'id' => 'message', 227 'dismissible' => true, 228 'additional_classes' => array( 'updated' ), 229 ) 230 ); 231 endif; 232 233 if ( isset( $_GET['error'] ) ) : 234 $message = ''; 235 if ( 'new-email' === $_GET['error'] ) : 236 $message = __( 'Error while saving the new email address. Please try again.' ); 237 endif; 238 wp_admin_notice( 239 $message, 240 array( 241 'type' => 'error', 242 ) 243 ); 244 endif; 245 246 if ( isset( $errors ) && is_wp_error( $errors ) ) { 247 ?> 229 248 <div class="error"> 230 249 <p><?php echo implode( "</p>\n<p>", $errors->get_error_messages() ); ?></p> 231 250 </div> 232 <?php endif; ?> 251 <?php 252 } 253 ?> 233 254 234 255 <div class="wrap" id="profile-page"> … … 803 824 <button type="button" name="do_new_application_password" id="do_new_application_password" class="button button-secondary"><?php _e( 'Add New Application Password' ); ?></button> 804 825 </div> 805 <?php else : ?> 806 <div class="notice notice-error inline"> 807 <p><?php _e( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ); ?></p> 808 </div> 809 <?php endif; ?> 826 <?php 827 else : 828 wp_admin_notice( 829 __( 'Your website appears to use Basic Authentication, which is not currently compatible with Application Passwords.' ), 830 array( 831 'type' => 'error', 832 'additional_classes' => array( 'inline' ), 833 ) 834 ); 835 endif; 836 ?> 810 837 811 838 <div class="application-passwords-list-table-wrapper"> -
trunk/src/wp-includes/functions.php
r56559 r56570 8319 8319 * @since 5.1.0 8320 8320 * @since 5.2.0 Added the `$before` and `$after` parameters. 8321 * @since 6.4.0 Added the `$echo` parameter. 8321 8322 * 8322 8323 * @param string $before Markup to output before the annotation. Default `<p class="description">`. 8323 8324 * @param string $after Markup to output after the annotation. Default `</p>`. 8324 */ 8325 function wp_update_php_annotation( $before = '<p class="description">', $after = '</p>' ) { 8325 * @param bool $echo Markup should echo if true. Default `true`. 8326 * 8327 * @return string|void 8328 */ 8329 function wp_update_php_annotation( $before = '<p class="description">', $after = '</p>', $echo = true ) { 8326 8330 $annotation = wp_get_update_php_annotation(); 8327 8331 8328 8332 if ( $annotation ) { 8329 echo $before . $annotation . $after; 8333 if ( $echo ) { 8334 echo $before . $annotation . $after; 8335 } else { 8336 return $before . $annotation . $after; 8337 } 8330 8338 } 8331 8339 }
Note: See TracChangeset
for help on using the changeset viewer.