Changeset 56409
- Timestamp:
- 08/17/2023 09:01:17 PM (16 months ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-ms-themes-list-table.php
r55971 r56409 860 860 echo apply_filters( 'theme_auto_update_setting_html', $html, $stylesheet, $theme ); 861 861 862 echo '<div class="notice notice-error notice-alt inline hidden"><p></p></div>'; 862 wp_admin_notice( 863 '', 864 array( 865 'type' => 'error', 866 'additional_classes' => array( 'notice-alt', 'inline', 'hidden' ), 867 ) 868 ); 863 869 } 864 870 -
trunk/src/wp-admin/includes/network.php
r55703 r56409 126 126 $active_plugins = get_option( 'active_plugins' ); 127 127 if ( ! empty( $active_plugins ) ) { 128 echo '<div class="notice notice-warning"><p><strong>' . __( 'Warning:' ) . '</strong> ' . sprintf( 129 /* translators: %s: URL to Plugins screen. */ 130 __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ), 131 admin_url( 'plugins.php?plugin_status=active' ) 132 ) . '</p></div>'; 128 wp_admin_notice( 129 '<strong>' . __( 'Warning:' ) . '</strong> ' . sprintf( 130 /* translators: %s: URL to Plugins screen. */ 131 __( 'Please <a href="%s">deactivate your plugins</a> before enabling the Network feature.' ), 132 admin_url( 'plugins.php?plugin_status=active' ) 133 ), 134 array( 'type' => 'warning' ) 135 ); 133 136 echo '<p>' . __( 'Once the network is created, you may reactivate your plugins.' ) . '</p>'; 134 137 echo '</div>'; … … 439 442 <h3><?php esc_html_e( 'Enabling the Network' ); ?></h3> 440 443 <p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p> 441 <div class="notice notice-warning inline"><p>442 444 <?php 445 $notice_message = '<strong>' . __( 'Caution:' ) . '</strong> '; 446 $notice_args = array( 447 'type' => 'warning', 448 'additional_classes' => 'inline', 449 ); 450 443 451 if ( file_exists( $home_path . '.htaccess' ) ) { 444 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 445 printf( 452 $notice_message .= sprintf( 446 453 /* translators: 1: wp-config.php, 2: .htaccess */ 447 454 __( 'You should back up your existing %1$s and %2$s files.' ), … … 450 457 ); 451 458 } elseif ( file_exists( $home_path . 'web.config' ) ) { 452 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 453 printf( 459 $notice_message .= sprintf( 454 460 /* translators: 1: wp-config.php, 2: web.config */ 455 461 __( 'You should back up your existing %1$s and %2$s files.' ), … … 458 464 ); 459 465 } else { 460 echo '<strong>' . __( 'Caution:' ) . '</strong> '; 461 printf( 466 $notice_message .= sprintf( 462 467 /* translators: %s: wp-config.php */ 463 468 __( 'You should back up your existing %s file.' ), … … 465 470 ); 466 471 } 467 ?> 468 </p></div> 469 <?php 472 473 wp_admin_notice( $notice_message, $notice_args ); 470 474 } 471 475 ?> -
trunk/src/wp-admin/my-sites.php
r55917 r56409 56 56 require_once ABSPATH . 'wp-admin/admin-header.php'; 57 57 58 if ( $updated ) { ?> 59 <div id="message" class="notice notice-success is-dismissible"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div> 60 <?php } ?> 58 if ( $updated ) { 59 wp_admin_notice( 60 '<strong>' . __( 'Settings saved.' ) . '</strong>', 61 array( 62 'type' => 'success', 63 'dismissible' => true, 64 'id' => 'message', 65 ) 66 ); 67 } 68 ?> 61 69 62 70 <div class="wrap"> … … 75 83 76 84 if ( empty( $blogs ) ) : 85 wp_admin_notice( 86 '<strong>' . __( 'You must be a member of at least one site to use this page.' ) . '</strong>', 87 array( 88 'type' => 'error', 89 'dismissible' => true, 90 ) 91 ); 77 92 ?> 78 <div class="notice notice-error is-dismissible"><p><strong><?php _e( 'You must be a member of at least one site to use this page.' ); ?></strong></p></div>79 93 <?php 80 94 else : -
trunk/src/wp-admin/network/settings.php
r55877 r56409 139 139 140 140 if ( isset( $_GET['updated'] ) ) { 141 ?> 142 <div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Settings saved.' ); ?></p></div> 143 <?php 141 wp_admin_notice( 142 __( 'Settings saved.' ), 143 array( 144 'type' => 'success', 145 'dismissible' => true, 146 'id' => 'message', 147 ) 148 ); 144 149 } 145 150 ?> … … 168 173 $new_admin_email = get_site_option( 'new_admin_email' ); 169 174 if ( $new_admin_email && get_site_option( 'admin_email' ) !== $new_admin_email ) : 170 ?> 171 <div class="notice notice-warning is-dismissible inline"> 172 <p> 173 <?php 174 printf( 175 /* translators: %s: New network admin email. */ 176 __( 'There is a pending change of the network admin email to %s.' ), 177 '<code>' . esc_html( $new_admin_email ) . '</code>' 178 ); 179 printf( 180 ' <a href="%1$s">%2$s</a>', 181 esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ), 182 __( 'Cancel' ) 183 ); 184 ?> 185 </p> 186 </div> 187 <?php endif; ?> 175 $notice_message = sprintf( 176 /* translators: %s: New network admin email. */ 177 __( 'There is a pending change of the network admin email to %s.' ), 178 '<code>' . esc_html( $new_admin_email ) . '</code>' 179 ); 180 181 $notice_message .= sprintf( 182 ' <a href="%1$s">%2$s</a>', 183 esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ), 184 __( 'Cancel' ) 185 ); 186 187 wp_admin_notice( 188 $notice_message, 189 array( 190 'type' => 'warning', 191 'dismissible' => true, 192 'additional_classes' => array( 'inline' ), 193 ) 194 ); 195 endif; 196 ?> 188 197 </td> 189 198 </tr> -
trunk/src/wp-admin/network/site-info.php
r55418 r56409 147 147 148 148 if ( ! empty( $messages ) ) { 149 $notice_args = array( 150 'type' => 'success', 151 'dismissible' => true, 152 'id' => 'message', 153 ); 154 149 155 foreach ( $messages as $msg ) { 150 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';156 wp_admin_notice( $msg, $notice_args ); 151 157 } 152 158 } -
trunk/src/wp-admin/network/site-new.php
r55894 r56409 193 193 <?php 194 194 if ( ! empty( $messages ) ) { 195 $notice_args = array( 196 'type' => 'success', 197 'dismissible' => true, 198 'id' => 'message', 199 ); 200 195 201 foreach ( $messages as $msg ) { 196 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';202 wp_admin_notice( $msg, $notice_args ); 197 203 } 198 204 } -
trunk/src/wp-admin/network/site-settings.php
r55988 r56409 105 105 106 106 if ( ! empty( $messages ) ) { 107 $notice_args = array( 108 'type' => 'success', 109 'dismissible' => true, 110 'id' => 'message', 111 ); 112 107 113 foreach ( $messages as $msg ) { 108 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';114 wp_admin_notice( $msg, $notice_args ); 109 115 } 110 116 } -
trunk/src/wp-admin/network/site-themes.php
r55618 r56409 197 197 $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled ); 198 198 } 199 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>'; 199 200 wp_admin_notice( 201 sprintf( $message, number_format_i18n( $enabled ) ), 202 array( 203 'type' => 'success', 204 'dismissible' => true, 205 'id' => 'message', 206 ) 207 ); 200 208 } elseif ( isset( $_GET['disabled'] ) ) { 201 209 $disabled = absint( $_GET['disabled'] ); … … 206 214 $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled ); 207 215 } 208 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>'; 216 217 wp_admin_notice( 218 sprintf( $message, number_format_i18n( $disabled ) ), 219 array( 220 'type' => 'success', 221 'dismissible' => true, 222 'id' => 'message', 223 ) 224 ); 209 225 } elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) { 210 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>'; 226 wp_admin_notice( 227 __( 'No theme selected.' ), 228 array( 229 'type' => 'error', 230 'dismissible' => true, 231 'id' => 'message', 232 ) 233 ); 211 234 } 212 235 ?> -
trunk/src/wp-admin/network/site-users.php
r55618 r56409 235 235 236 236 if ( isset( $_GET['update'] ) ) : 237 $message = ''; 238 $type = 'error'; 239 237 240 switch ( $_GET['update'] ) { 238 241 case 'adduser': 239 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User added.' ) . '</p></div>'; 242 $type = 'success'; 243 $message = __( 'User added.' ); 240 244 break; 241 245 case 'err_add_member': 242 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';246 $message = __( 'User is already a member of this site.' ); 243 247 break; 244 248 case 'err_add_fail': 245 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';249 $message = __( 'User could not be added to this site.' ); 246 250 break; 247 251 case 'err_add_notfound': 248 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';252 $message = __( 'Enter the username of an existing user.' ); 249 253 break; 250 254 case 'promote': 251 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>'; 255 $type = 'success'; 256 $message = __( 'Changed roles.' ); 252 257 break; 253 258 case 'err_promote': 254 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';259 $message = __( 'Select a user to change role.' ); 255 260 break; 256 261 case 'remove': 257 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>'; 262 $type = 'success'; 263 $message = __( 'User removed from this site.' ); 258 264 break; 259 265 case 'err_remove': 260 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';266 $message = __( 'Select a user to remove.' ); 261 267 break; 262 268 case 'newuser': 263 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User created.' ) . '</p></div>'; 269 $type = 'success'; 270 $message = __( 'User created.' ); 264 271 break; 265 272 case 'err_new': 266 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';273 $message = __( 'Enter the username and email.' ); 267 274 break; 268 275 case 'err_new_dup': 269 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';276 $message = __( 'Duplicated username or email address.' ); 270 277 break; 271 278 } 279 280 wp_admin_notice( 281 $message, 282 array( 283 'type' => $type, 284 'dismissible' => true, 285 'id' => 'message', 286 ) 287 ); 272 288 endif; 273 289 ?> -
trunk/src/wp-admin/network/sites.php
r55876 r56409 359 359 360 360 if ( ! empty( $msg ) ) { 361 $msg = '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>'; 361 $msg = wp_get_admin_notice( 362 $msg, 363 array( 364 'type' => 'success', 365 'dismissible' => true, 366 'id' => 'message', 367 ) 368 ); 362 369 } 363 370 } -
trunk/src/wp-admin/network/themes.php
r55988 r56409 368 368 369 369 <?php 370 $message = ''; 371 $type = 'success'; 372 370 373 if ( isset( $_GET['enabled'] ) ) { 371 374 $enabled = absint( $_GET['enabled'] ); … … 373 376 $message = __( 'Theme enabled.' ); 374 377 } else { 375 /* translators: %s: Number of themes. */ 376 $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled ); 377 } 378 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>'; 378 $message = sprintf( 379 /* translators: %s: Number of themes. */ 380 _n( '%s theme enabled.', '%s themes enabled.', $enabled ), 381 number_format_i18n( $enabled ) 382 ); 383 } 379 384 } elseif ( isset( $_GET['disabled'] ) ) { 380 385 $disabled = absint( $_GET['disabled'] ); … … 382 387 $message = __( 'Theme disabled.' ); 383 388 } else { 384 /* translators: %s: Number of themes. */ 385 $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled ); 386 } 387 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>'; 389 $message = sprintf( 390 /* translators: %s: Number of themes. */ 391 _n( '%s theme disabled.', '%s themes disabled.', $disabled ), 392 number_format_i18n( $disabled ) 393 ); 394 } 388 395 } elseif ( isset( $_GET['deleted'] ) ) { 389 396 $deleted = absint( $_GET['deleted'] ); … … 391 398 $message = __( 'Theme deleted.' ); 392 399 } else { 393 /* translators: %s: Number of themes. */ 394 $message = _n( '%s theme deleted.', '%s themes deleted.', $deleted ); 395 } 396 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>'; 400 $message = sprintf( 401 /* translators: %s: Number of themes. */ 402 _n( '%s theme deleted.', '%s themes deleted.', $deleted ), 403 number_format_i18n( $deleted ) 404 ); 405 } 397 406 } elseif ( isset( $_GET['enabled-auto-update'] ) ) { 398 407 $enabled = absint( $_GET['enabled-auto-update'] ); … … 400 409 $message = __( 'Theme will be auto-updated.' ); 401 410 } else { 402 /* translators: %s: Number of themes. */ 403 $message = _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled ); 404 } 405 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>'; 411 $message = sprintf( 412 /* translators: %s: Number of themes. */ 413 _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled ), 414 number_format_i18n( $enabled ) 415 ); 416 } 406 417 } elseif ( isset( $_GET['disabled-auto-update'] ) ) { 407 418 $disabled = absint( $_GET['disabled-auto-update'] ); … … 409 420 $message = __( 'Theme will no longer be auto-updated.' ); 410 421 } else { 411 /* translators: %s: Number of themes. */ 412 $message = _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled ); 413 } 414 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>'; 422 $message = sprintf( 423 /* translators: %s: Number of themes. */ 424 _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled ), 425 number_format_i18n( $disabled ) 426 ); 427 } 415 428 } elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) { 416 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>'; 429 $message = __( 'No theme selected.' ); 430 $type = 'error'; 417 431 } elseif ( isset( $_GET['error'] ) && 'main' === $_GET['error'] ) { 418 echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>'; 419 } 420 432 $message = __( 'You cannot delete a theme while it is active on the main site.' ); 433 $type = 'error'; 434 } 435 436 if ( '' !== $message ) { 437 wp_admin_notice( 438 $message, 439 array( 440 'type' => $type, 441 'dismissible' => true, 442 'id' => 'message', 443 ) 444 ); 445 } 421 446 ?> 422 447 -
trunk/src/wp-admin/network/user-new.php
r55618 r56409 108 108 <?php 109 109 if ( '' !== $message ) { 110 echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $message . '</p></div>'; 110 wp_admin_notice( 111 $message, 112 array( 113 'type' => 'success', 114 'dismissible' => true, 115 'id' => 'message', 116 ) 117 ); 111 118 } 112 119 113 120 if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) { 114 ?> 115 <div id="message" class="notice notice-error is-dismissible"> 116 <?php 117 foreach ( $add_user_errors->get_error_messages() as $error ) { 118 echo "<p>$error</p>"; 119 } 120 ?> 121 </div> 122 <?php } ?> 121 $error_messages = ''; 122 foreach ( $add_user_errors->get_error_messages() as $error ) { 123 $error_messages .= "<p>$error</p>"; 124 } 125 126 wp_admin_notice( 127 $error_messages, 128 array( 129 'type' => 'error', 130 'dismissible' => true, 131 'id' => 'message', 132 'paragraph_wrap' => false, 133 ) 134 ); 135 } 136 ?> 123 137 <form action="<?php echo esc_url( network_admin_url( 'user-new.php?action=add-user' ) ); ?>" id="adduser" method="post" novalidate="novalidate"> 124 138 <p><?php echo wp_required_field_message(); ?></p> -
trunk/src/wp-admin/network/users.php
r55877 r56409 255 255 256 256 if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) { 257 ?> 258 <div id="message" class="notice notice-success is-dismissible"><p> 259 <?php 260 switch ( $_REQUEST['action'] ) { 261 case 'delete': 262 _e( 'User deleted.' ); 263 break; 264 case 'all_spam': 265 _e( 'Users marked as spam.' ); 266 break; 267 case 'all_notspam': 268 _e( 'Users removed from spam.' ); 269 break; 270 case 'all_delete': 271 _e( 'Users deleted.' ); 272 break; 273 case 'add': 274 _e( 'User added.' ); 275 break; 276 } 277 ?> 278 </p></div> 279 <?php 257 $message = ''; 258 switch ( $_REQUEST['action'] ) { 259 case 'delete': 260 $message = __( 'User deleted.' ); 261 break; 262 case 'all_spam': 263 $message = __( 'Users marked as spam.' ); 264 break; 265 case 'all_notspam': 266 $message = __( 'Users removed from spam.' ); 267 break; 268 case 'all_delete': 269 $message = __( 'Users deleted.' ); 270 break; 271 case 'add': 272 $message = __( 'User added.' ); 273 break; 274 } 275 276 wp_admin_notice( 277 $message, 278 array( 279 'type' => 'success', 280 'dismissible' => true, 281 'id' => 'message', 282 ) 283 ); 280 284 } 281 285 ?>
Note: See TracChangeset
for help on using the changeset viewer.