Changeset 56573
- Timestamp:
- 09/14/2023 02:13:42 AM (15 months ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-comments.php
r56549 r56573 412 412 } 413 413 414 printf( 415 '<div id="moderated" class="updated notice is-dismissible"><p>%s</p></div>', 416 implode( "<br />\n", $messages ) 414 wp_admin( 415 implode( "<br />\n", $messages ), 416 array( 417 'id' => 'moderated', 418 'additional_classes' => array( 'updated' ), 419 'dismissible' => true, 420 ) 417 421 ); 418 422 } -
trunk/src/wp-admin/edit-link-form.php
r56515 r56573 92 92 <hr class="wp-header-end"> 93 93 94 <?php if ( isset( $_GET['added'] ) ) : ?> 95 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Link added.' ); ?></p></div> 96 <?php endif; ?> 94 <?php 95 if ( isset( $_GET['added'] ) ) { 96 wp_admin_notice( 97 __( 'Link added.' ), 98 array( 99 'id' => 'message', 100 'additional_classes' => array( 'updated' ), 101 'dismissible' => true, 102 ) 103 ); 104 } 105 ?> 97 106 98 107 <form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php"> -
trunk/src/wp-admin/edit.php
r56549 r56573 470 470 471 471 if ( $messages ) { 472 printf( 473 '<div id="message" class="updated notice is-dismissible"><p>%s</p></div>', 474 implode( ' ', $messages ) 472 wp_admin_notice( 473 implode( ' ', $messages ), 474 array( 475 'id' => 'message', 476 'additional_classes' => array( 'updated' ), 477 'dismissible' => true, 478 ) 475 479 ); 476 480 } -
trunk/src/wp-admin/link-manager.php
r56515 r56573 120 120 <?php 121 121 if ( isset( $_REQUEST['deleted'] ) ) { 122 echo '<div id="message" class="updated notice is-dismissible"><p>';123 122 $deleted = (int) $_REQUEST['deleted']; 124 123 /* translators: %s: Number of links. */ 125 printf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted ); 126 echo '</p></div>'; 124 $deleted_message = sprintf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted ); 125 wp_admin_notice( 126 $deleted_message, 127 array( 128 'id' => 'message', 129 'additional_classes' => array( 'updated' ), 130 'dismissible' => true, 131 ) 132 ); 127 133 $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] ); 128 134 } -
trunk/src/wp-admin/nav-menus.php
r56449 r56573 282 282 283 283 if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) { 284 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The menu item has been successfully deleted.' ) . '</p></div>'; 284 $messages[] = wp_get_admin_notice( 285 __( 'The menu item has been successfully deleted.' ), 286 array( 287 'id' => 'message', 288 'additional_classes' => array( 'updated' ), 289 'dismissible' => true, 290 ) 291 ); 285 292 } 286 293 … … 303 310 304 311 if ( is_wp_error( $deletion ) ) { 305 $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>'; 312 $messages[] = wp_get_admin_notice( 313 $deletion->get_error_message(), 314 array( 315 'id' => 'message', 316 'additional_classes' => array( 'error' ), 317 'dismissible' => true, 318 ) 319 ); 306 320 } else { 307 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>'; 321 $messages[] = wp_get_admin_notice( 322 __( 'The menu has been successfully deleted.' ), 323 array( 324 'id' => 'message', 325 'additional_classes' => array( 'updated' ), 326 'dismissible' => true, 327 ) 328 ); 308 329 } 309 330 … … 321 342 322 343 if ( is_wp_error( $deletion ) ) { 323 $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>'; 344 $messages[] = wp_get_admin_notice( 345 $deletion->get_error_message(), 346 array( 347 'id' => 'message', 348 'additional_classes' => array( 'error' ), 349 'dismissible' => true, 350 ) 351 ); 324 352 $deletion_error = true; 325 353 } … … 327 355 328 356 if ( empty( $deletion_error ) ) { 329 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>'; 357 $messages[] = wp_get_admin_notice( 358 __( 'Selected menus have been successfully deleted.' ), 359 array( 360 'id' => 'message', 361 'additional_classes' => array( 'updated' ), 362 'dismissible' => true, 363 ) 364 ); 330 365 } 331 366 … … 432 467 if ( is_wp_error( $_nav_menu_selected_id ) ) { 433 468 $_menu_object = $_nav_menu_selected_id; 434 $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>'; 469 $messages[] = wp_get_admin_notice( 470 $_nav_menu_selected_id->get_error_message(), 471 array( 472 'id' => 'message', 473 'additional_classes' => array( 'error' ), 474 'dismissible' => true, 475 ) 476 ); 435 477 } else { 436 478 $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id ); … … 615 657 616 658 if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) { 617 $message s[] = '<div id="message" class="updated"><p>' .sprintf(659 $message_no_theme_support = sprintf( 618 660 /* translators: %s: URL to Widgets screen. */ 619 661 __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Navigation Menu” widget on the <a href="%s">Widgets</a> screen.' ), 620 662 admin_url( 'widgets.php' ) 621 ) . '</p></div>'; 663 ); 664 $messages[] = wp_get_admin_notice( 665 $message_no_theme_support, 666 array( 667 'id' => 'message', 668 'additional_classes' => array( 'updated' ), 669 'dismissible' => true, 670 ) 671 ); 622 672 } 623 673 -
trunk/src/wp-admin/options-general.php
r56203 r56573 140 140 <?php 141 141 $new_admin_email = get_option( 'new_admin_email' ); 142 if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) :143 ?>144 <div class="updated inline">145 <p>146 <?php147 printf(148 /* translators: %s: New admin email. */149 __( 'There is a pending change of the admin email to %s.' ),150 '<code>' . esc_html( $new_admin_email ) . '</code>'151 );152 printf(153 ' <a href="%1$s">%2$s</a>',154 esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),155 __( 'Cancel' )156 );157 ?>158 </p>159 </div> 160 <?php endif;?>142 if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) { 143 $pending_admin_email_message = sprintf( 144 /* translators: %s: New admin email. */ 145 __( 'There is a pending change of the admin email to %s.' ), 146 '<code>' . esc_html( $new_admin_email ) . '</code>' 147 ); 148 $pending_admin_email_message .= sprintf( 149 ' <a href="%1$s">%2$s</a>', 150 esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ), 151 __( 'Cancel' ) 152 ); 153 wp_admin_notice( 154 $pending_admin_email_message, 155 array( 156 'additional_classes' => array( 'updated', 'inline' ), 157 ) 158 ); 159 } 160 ?> 161 161 </td> 162 162 </tr> -
trunk/src/wp-admin/plugins.php
r56515 r56573 619 619 } 620 620 621 if ( isset( $_GET['error'] ) ) :621 if ( isset( $_GET['error'] ) ) { 622 622 623 623 if ( isset( $_GET['main'] ) ) { … … 640 640 } 641 641 642 ?>643 <div id="message" class="error"><p><?php echo $errmsg; ?></p>644 <?php645 646 642 if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] ) 647 643 && isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin ) … … 656 652 ); 657 653 658 ?> 659 <iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe> 660 <?php 654 $errmsg .= '<iframe style="border:0" width="100%" height="70px" src="' . esc_url( $iframe_url ) . '"></iframe>'; 661 655 } 662 656 663 ?> 664 </div> 665 <?php 666 elseif ( isset( $_GET['deleted'] ) ) : 657 wp_admin_notice( 658 $errmsg, 659 array( 660 'id' => 'message', 661 'additional_classes' => array( 'error' ), 662 ) 663 ); 664 665 } elseif ( isset( $_GET['deleted'] ) ) { 667 666 $delete_result = get_transient( 'plugins_delete_result_' . $user_ID ); 668 667 // Delete it once we're done. 669 668 delete_transient( 'plugins_delete_result_' . $user_ID ); 670 669 671 if ( is_wp_error( $delete_result ) ) : 672 ?> 673 <div id="message" class="error notice is-dismissible"> 674 <p> 675 <?php 676 printf( 677 /* translators: %s: Error message. */ 678 __( 'Plugin could not be deleted due to an error: %s' ), 679 esc_html( $delete_result->get_error_message() ) 680 ); 681 ?> 682 </p> 683 </div> 684 <?php else : ?> 685 <div id="message" class="updated notice is-dismissible"> 686 <p> 687 <?php 688 if ( 1 === (int) $_GET['deleted'] ) { 689 _e( 'The selected plugin has been deleted.' ); 690 } else { 691 _e( 'The selected plugins have been deleted.' ); 692 } 693 ?> 694 </p> 695 </div> 696 <?php endif; ?> 697 <?php elseif ( isset( $_GET['activate'] ) ) : ?> 698 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin activated.' ); ?></p></div> 699 <?php elseif ( isset( $_GET['activate-multi'] ) ) : ?> 700 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins activated.' ); ?></p></div> 701 <?php elseif ( isset( $_GET['deactivate'] ) ) : ?> 702 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin deactivated.' ); ?></p></div> 703 <?php elseif ( isset( $_GET['deactivate-multi'] ) ) : ?> 704 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins deactivated.' ); ?></p></div> 705 <?php elseif ( 'update-selected' === $action ) : ?> 706 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'All selected plugins are up to date.' ); ?></p></div> 707 <?php elseif ( isset( $_GET['resume'] ) ) : ?> 708 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin resumed.' ); ?></p></div> 709 <?php elseif ( isset( $_GET['enabled-auto-update'] ) ) : ?> 710 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin will be auto-updated.' ); ?></p></div> 711 <?php elseif ( isset( $_GET['disabled-auto-update'] ) ) : ?> 712 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin will no longer be auto-updated.' ); ?></p></div> 713 <?php elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) : ?> 714 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins will be auto-updated.' ); ?></p></div> 715 <?php elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) : ?> 716 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins will no longer be auto-updated.' ); ?></p></div> 717 <?php endif; ?> 670 if ( is_wp_error( $delete_result ) ) { 671 $plugin_not_deleted_message = sprintf( 672 /* translators: %s: Error message. */ 673 __( 'Plugin could not be deleted due to an error: %s' ), 674 esc_html( $delete_result->get_error_message() ) 675 ); 676 wp_admin_notice( 677 $plugin_not_deleted_message, 678 array( 679 'id' => 'message', 680 'additional_classes' => array( 'error' ), 681 'dismissible' => true, 682 ) 683 ); 684 } else { 685 $updated_args = array( 686 'id' => 'message', 687 'additional_classes' => array( 'updated' ), 688 'dismissible' => true, 689 ); 690 if ( 1 === (int) $_GET['deleted'] ) { 691 $plugins_deleted_message = __( 'The selected plugin has been deleted.' ); 692 } else { 693 $plugins_deleted_message = __( 'The selected plugins have been deleted.' ); 694 } 695 wp_admin_notice( $plugins_deleted_message, $updated_args ); 696 } 697 } elseif ( isset( $_GET['activate'] ) ) { 698 wp_admin_notice( __( 'Plugin activated.' ), $updated_args ); 699 } elseif ( isset( $_GET['activate-multi'] ) ) { 700 wp_admin_notice( __( 'Selected plugins activated.' ), $updated_args ); 701 } elseif ( isset( $_GET['deactivate'] ) ) { 702 wp_admin_notice( __( 'Plugin deactivated.' ), $updated_args ); 703 } elseif ( isset( $_GET['deactivate-multi'] ) ) { 704 wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_args ); 705 } elseif ( 'update-selected' === $action ) { 706 wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_args ); 707 } elseif ( isset( $_GET['resume'] ) ) { 708 wp_admin_notice( __( 'Plugin resumed.' ), $updated_args ); 709 } elseif ( isset( $_GET['enabled-auto-update'] ) ) { 710 wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_args ); 711 } elseif ( isset( $_GET['disabled-auto-update'] ) ) { 712 wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_args ); 713 } elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) { 714 wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_args ); 715 } elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) { 716 wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_args ); 717 } 718 ?> 718 719 719 720 <div class="wrap"> -
trunk/src/wp-admin/themes.php
r56570 r56573 261 261 <?php 262 262 if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) { 263 ?> 264 <div id="message1" class="updated notice is-dismissible"><p><?php _e( 'The active theme is broken. Reverting to the default theme.' ); ?></p></div> 265 <?php 263 wp_admin_notice( 264 __( 'The active theme is broken. Reverting to the default theme.' ), 265 array( 266 'id' => 'message1', 267 'additional_classes' => array( 'updated' ), 268 'dismissible' => true, 269 ) 270 ); 266 271 } elseif ( isset( $_GET['activated'] ) ) { 267 272 if ( isset( $_GET['previewed'] ) ) { 268 ?> 269 <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Visit site' ); ?></a></p></div> 270 <?php 273 wp_admin_notice( 274 __( 'Settings saved and theme activated.' ) . '<a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>', 275 array( 276 'id' => 'message2', 277 'additional_classes' => array( 'updated' ), 278 'dismissible' => true, 279 ) 280 ); 271 281 } else { 272 ?> 273 <div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Visit site' ); ?></a></p></div> 274 <?php 282 wp_admin_notice( 283 __( 'New theme activated.' ) . '<a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>', 284 array( 285 'id' => 'message2', 286 'additional_classes' => array( 'updated' ), 287 'dismissible' => true, 288 ) 289 ); 275 290 } 276 291 } elseif ( isset( $_GET['deleted'] ) ) { 277 ?> 278 <div id="message3" class="updated notice is-dismissible"><p><?php _e( 'Theme deleted.' ); ?></p></div> 279 <?php 292 wp_admin_notice( 293 __( 'Theme deleted.' ), 294 array( 295 'id' => 'message3', 296 'additional_classes' => array( 'updated' ), 297 'dismissible' => true, 298 ) 299 ); 280 300 } elseif ( isset( $_GET['delete-active-child'] ) ) { 281 ?> 282 <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div> 283 <?php 301 wp_admin_notice( 302 __( 'You cannot delete a theme while it has an active child theme.' ), 303 array( 304 'id' => 'message4', 305 'additional_classes' => array( 'error' ), 306 ) 307 ); 284 308 } elseif ( isset( $_GET['resumed'] ) ) { 285 ?> 286 <div id="message5" class="updated notice is-dismissible"><p><?php _e( 'Theme resumed.' ); ?></p></div> 287 <?php 309 wp_admin_notice( 310 __( 'Theme resumed.' ), 311 array( 312 'id' => 'message5', 313 'additional_classes' => array( 'updated' ), 314 'dismissible' => true, 315 ) 316 ); 288 317 } elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) { 289 ?> 290 <div id="message6" class="error"><p><?php _e( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ); ?></p></div> 291 <?php 318 wp_admin_notice( 319 __( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ), 320 array( 321 'id' => 'message6', 322 'additional_classes' => array( 'error' ), 323 ) 324 ); 292 325 } elseif ( isset( $_GET['enabled-auto-update'] ) ) { 293 ?> 294 <div id="message7" class="updated notice is-dismissible"><p><?php _e( 'Theme will be auto-updated.' ); ?></p></div> 295 <?php 326 wp_admin_notice( 327 __( 'Theme will be auto-updated.' ), 328 array( 329 'id' => 'message7', 330 'additional_classes' => array( 'updated' ), 331 'dismissible' => true, 332 ) 333 ); 296 334 } elseif ( isset( $_GET['disabled-auto-update'] ) ) { 297 ?> 298 <div id="message8" class="updated notice is-dismissible"><p><?php _e( 'Theme will no longer be auto-updated.' ); ?></p></div> 299 <?php 335 wp_admin_notice( 336 __( 'Theme will no longer be auto-updated.' ), 337 array( 338 'id' => 'message8', 339 'additional_classes' => array( 'updated' ), 340 'dismissible' => true, 341 ) 342 ); 300 343 } 301 344 -
trunk/src/wp-admin/upload.php
r56559 r56573 219 219 <hr class="wp-header-end"> 220 220 221 <?php if ( ! empty( $message ) ) : ?> 222 <div id="message" class="updated notice is-dismissible"><p><?php echo $message; ?></p></div> 223 <?php endif; ?> 224 225 <div class="error hide-if-js"> 226 <p> 227 <?php 228 printf( 229 /* translators: %s: List view URL. */ 230 __( 'The grid view for the Media Library requires JavaScript. <a href="%s">Switch to the list view</a>.' ), 231 'upload.php?mode=list' 221 <?php 222 if ( ! empty( $message ) ) { 223 wp_admin_notice( 224 $message, 225 array( 226 'id' => 'message', 227 'additional_classes' => array( 'updated' ), 228 'dismissible' => true, 229 ) 232 230 ); 233 ?> 234 </p> 235 </div> 231 } 232 233 if ( ! empty( $message ) ) { 234 wp_admin_notice( 235 $message, 236 array( 237 'id' => 'message', 238 'additional_classes' => array( 'updated' ), 239 'dismissible' => true, 240 ) 241 ); 242 } 243 244 $js_required_message = sprintf( 245 /* translators: %s: List view URL. */ 246 __( 'The grid view for the Media Library requires JavaScript. <a href="%s">Switch to the list view</a>.' ), 247 'upload.php?mode=list' 248 ); 249 wp_admin_notice( 250 $js_required_message, 251 array( 252 additional_classes( 'error', 'hide-if-js' ), 253 ) 254 ); 255 ?> 236 256 </div> 237 257 <?php … … 427 447 <hr class="wp-header-end"> 428 448 429 <?php if ( ! empty( $message ) ) : ?> 430 <div id="message" class="updated notice is-dismissible"><p><?php echo $message; ?></p></div> 431 <?php endif; ?> 449 <?php 450 if ( ! empty( $message ) ) { 451 wp_admin_notice( 452 $message, 453 array( 454 'id' => 'message', 455 'additional_classes' => array( 'updated' ), 456 'dismissible' => true, 457 ) 458 ); 459 } 460 ?> 432 461 433 462 <form id="posts-filter" method="get"> -
trunk/src/wp-admin/user-edit.php
r56570 r56573 546 546 <?php endif; ?> 547 547 548 <?php $new_email = get_user_meta( $current_user->ID, '_new_email', true ); ?> 549 <?php if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) : ?> 550 <div class="updated inline"> 551 <p> 552 <?php 553 printf( 554 /* translators: %s: New email. */ 555 __( 'There is a pending change of your email to %s.' ), 556 '<code>' . esc_html( $new_email['newemail'] ) . '</code>' 557 ); 558 printf( 559 ' <a href="%1$s">%2$s</a>', 560 esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ), 561 __( 'Cancel' ) 562 ); 563 ?> 564 </p> 565 </div> 566 <?php endif; ?> 548 <?php 549 $new_email = get_user_meta( $current_user->ID, '_new_email', true ); 550 if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) : 551 552 $pending_change_message = sprintf( 553 /* translators: %s: New email. */ 554 __( 'There is a pending change of your email to %s.' ), 555 '<code>' . esc_html( $new_email['newemail'] ) . '</code>' 556 ); 557 $pending_change_message .= sprintf( 558 ' <a href="%1$s">%2$s</a>', 559 esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ), 560 __( 'Cancel' ) 561 ); 562 wp_admin_notice( 563 $pending_change_message, 564 array( 565 'additional_classes' => array( 'updated', 'inline' ), 566 ) 567 ); 568 endif; 569 ?> 567 570 </td> 568 571 </tr> -
trunk/src/wp-admin/user-new.php
r56008 r56573 397 397 if ( ! empty( $messages ) ) { 398 398 foreach ( $messages as $msg ) { 399 echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>'; 399 wp_admin_notice( 400 $msg, 401 array( 402 'id' => 'message', 403 'additional_classes' => array( 'updated' ), 404 'dismissible' => true, 405 ) 406 ); 400 407 } 401 408 } -
trunk/src/wp-admin/users.php
r56549 r56573 611 611 $message = _n( '%s user deleted.', '%s users deleted.', $delete_count ); 612 612 } 613 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>'; 613 $message = sprintf( $message, number_format_i18n( $delete_count ) ); 614 $messages[] = wp_get_admin_notice( 615 $message, 616 array( 617 'id' => 'message', 618 'additional_classes' => array( 'updated' ), 619 'dismissible' => true, 620 ) 621 ); 614 622 break; 615 623 case 'add': 616 624 $message = __( 'New user created.' ); 617 618 625 $user_id = isset( $_GET['id'] ) ? $_GET['id'] : false; 619 626 if ( $user_id && current_user_can( 'edit_user', $user_id ) ) { … … 631 638 } 632 639 633 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>'; 640 $messages[] = wp_get_admin_notice( 641 $message, 642 array( 643 'id' => 'message', 644 'additional_classes' => array( 'updated' ), 645 'dismissible' => true, 646 ) 647 ); 634 648 break; 635 649 case 'resetpassword': … … 641 655 $message = _n( 'Password reset links sent to %s user.', 'Password reset links sent to %s users.', $reset_count ); 642 656 } 643 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $reset_count ) ) . '</p></div>'; 657 $message = sprintf( $message, number_format_i18n( $reset_count ) ); 658 $messages[] = wp_get_admin_notice( 659 $message, 660 array( 661 'id' => 'message', 662 'additional_classes' => array( 'updated' ), 663 'dismissible' => true, 664 ) 665 ); 644 666 break; 645 667 case 'promote': 646 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; 668 $messages[] = wp_get_admin_notice( 669 __( 'Changed roles.' ), 670 array( 671 'id' => 'message', 672 'additional_classes' => array( 'updated' ), 673 'dismissible' => true, 674 ) 675 ); 647 676 break; 648 677 case 'err_admin_role': 649 $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'The current user’s role must have user editing capabilities.' ) . '</p></div>'; 650 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>'; 678 $messages[] = wp_get_admin_notice( 679 __( 'The current user’s role must have user editing capabilities.' ), 680 array( 681 'id' => 'message', 682 'additional_classes' => array( 'error' ), 683 'dismissible' => true, 684 ) 685 ); 686 $messages[] = wp_get_admin_notice( 687 __( 'Other user roles have been changed.' ), 688 array( 689 'id' => 'message', 690 'additional_classes' => array( 'updated' ), 691 'dismissible' => true, 692 ) 693 ); 651 694 break; 652 695 case 'err_admin_del': 653 $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You cannot delete the current user.' ) . '</p></div>'; 654 $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other users have been deleted.' ) . '</p></div>'; 696 $messages[] = wp_get_admin_notice( 697 __( 'You cannot delete the current user.' ), 698 array( 699 'id' => 'message', 700 'additional_classes' => array( 'error' ), 701 'dismissible' => true, 702 ) 703 ); 704 $messages[] = wp_get_admin_notice( 705 __( 'Other users have been deleted.' ), 706 array( 707 'id' => 'message', 708 'additional_classes' => array( 'updated' ), 709 'dismissible' => true, 710 ) 711 ); 655 712 break; 656 713 case 'remove': 657 $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'User removed from this site.' ) . '</p></div>'; 714 $messages[] = wp_get_admin_notice( 715 __( 'User removed from this site.' ), 716 array( 717 'id' => 'message', 718 'additional_classes' => array( 'updated', 'fade' ), 719 'dismissible' => true, 720 ) 721 ); 658 722 break; 659 723 case 'err_admin_remove': 660 $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You cannot remove the current user.' ) . '</p></div>'; 661 $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'Other users have been removed.' ) . '</p></div>'; 724 $messages[] = wp_get_admin_notice( 725 __( 'You cannot remove the current user.' ), 726 array( 727 'id' => 'message', 728 'additional_classes' => array( 'error' ), 729 'dismissible' => true, 730 ) 731 ); 732 $messages[] = wp_get_admin_notice( 733 __( 'Other users have been removed.' ), 734 array( 735 'id' => 'message', 736 'additional_classes' => array( 'updated', 'fade' ), 737 'dismissible' => true, 738 ) 739 ); 662 740 break; 663 741 } -
trunk/src/wp-admin/widgets-form.php
r56549 r56573 404 404 <hr class="wp-header-end"> 405 405 406 <?php if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { ?> 407 <div id="message" class="updated notice is-dismissible"><p><?php echo $messages[ $_GET['message'] ]; ?></p></div> 408 <?php } ?> 409 <?php if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) { ?> 410 <div id="message" class="error"><p><?php echo $errors[ $_GET['error'] ]; ?></p></div> 411 <?php } ?> 412 413 <?php 406 <?php 407 if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { 408 wp_admin_notice( 409 $messages[ $_GET['message'] ], 410 array( 411 'id' => 'message', 412 'additional_classes' => array( 'updated' ), 413 'dismissible' => true, 414 ) 415 ); 416 } 417 if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) { 418 wp_admin_notice( 419 $errors[ $_GET['error'] ], 420 array( 421 'id' => 'message', 422 'additional_classes' => array( 'error' ), 423 'dismissible' => true, 424 ) 425 ); 426 } 427 414 428 /** 415 429 * Fires before the Widgets administration page content loads.
Note: See TracChangeset
for help on using the changeset viewer.