WordPress.org

Make WordPress Core

Changeset 31973


Ignore:
Timestamp:
04/01/2015 10:05:17 PM (5 years ago)
Author:
helen
Message:

Admin notices: Make (most) core notices dismissible.

These no longer return upon refreshing the page when JS is on and working, so users should be able to dismiss them. This is particularly important on the post edit screen when DFW is triggered, but pretty much all notices can be dismissed if needed. A post on Make/Core will follow with information on how this can be leveraged in plugins.

props valendesigns, afercia, paulwilde, adamsilverstein, helen.
fixes #31233. see #23367.

Location:
trunk/src
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r31786 r31973  
    739739#welcome-panel.welcome-panel .welcome-panel-close:before,
    740740.tagchecklist span a:before,
    741 #bulk-titles div a:before {
     741#bulk-titles div a:before,
     742.notice-dismiss:before {
    742743    background: none;
    743744    color: #bbb;
     
    12891290}
    12901291
     1292.notice.is-dismissible {
     1293    padding-right: 38px;
     1294    position: relative;
     1295}
     1296
     1297.notice-dismiss {
     1298    height: 38px;
     1299    width: 38px;
     1300    position: absolute;
     1301    top: 0;
     1302    right: 0;
     1303    border: none;
     1304    margin: 0;
     1305    padding: 11px;
     1306    background: none;
     1307    color: #bbb;
     1308    cursor: pointer;
     1309}
     1310
     1311.notice-dismiss:hover:before,
     1312.notice-dismiss:active:before,
     1313.notice-dismiss:focus:before {
     1314    color: #c00;
     1315}
     1316
     1317.notice-dismiss:active,
     1318.notice-dismiss:focus {
     1319    outline: none;
     1320    -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
     1321    box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8);
     1322    color: #c00;
     1323}
     1324
     1325.ie8 .notice-dismiss:focus {
     1326    outline: 1px solid #5b9dd9;
     1327}
     1328
    12911329.notice-success,
    12921330div.updated {
    1293      border-color: #7ad03a;
     1331    border-color: #7ad03a;
    12941332}
    12951333
    12961334.notice-warning {
    1297     border-color: #ffba00;
     1335    border-color: #ffba00;
    12981336}
    12991337
    13001338.notice-error,
    13011339div.error {
    1302     border-color: #dd3d36;
     1340    border-color: #dd3d36;
    13031341}
    13041342
    13051343.notice-info {
    1306     border-color: #00a0d2;
     1344    border-color: #00a0d2;
    13071345}
    13081346
     
    31233161
    31243162    /* Feedback Messages */
    3125     .wrap div.updated, .wrap div.error, .media-upload-form div.error {
     3163    .notice,
     3164    .wrap div.updated,
     3165    .wrap div.error,
     3166    .media-upload-form div.error {
    31263167        margin: 20px 0 10px 0;
    31273168        padding: 5px 10px;
    31283169        font-size: 14px;
    31293170        line-height: 175%;
     3171    }
     3172
     3173    .notice.is-dismissible {
     3174        padding-right: 46px;
     3175    }
     3176
     3177    .notice-dismiss {
     3178        height: 46px;
     3179        width: 46px;
     3180        padding: 16px;
    31303181    }
    31313182
  • trunk/src/wp-admin/edit-comments.php

    r31696 r31973  
    218218        }
    219219
    220         echo '<div id="moderated" class="updated"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
     220        echo '<div id="moderated" class="updated notice is-dismissible"><p>' . implode( "<br/>\n", $messages ) . '</p></div>';
    221221    }
    222222}
  • trunk/src/wp-admin/edit-form-advanced.php

    r31862 r31973  
    411411<?php endif; ?>
    412412<?php if ( $message ) : ?>
    413 <div id="message" class="updated"><p><?php echo $message; ?></p></div>
     413<div id="message" class="updated notice notice-success is-dismissible"><p><?php echo $message; ?></p></div>
    414414<?php endif; ?>
    415415<div id="lost-connection-notice" class="error hidden">
  • trunk/src/wp-admin/edit-link-form.php

    r28485 r31973  
    7474
    7575<?php if ( isset( $_GET['added'] ) ) : ?>
    76 <div id="message" class="updated"><p><?php _e('Link added.'); ?></p></div>
     76<div id="message" class="updated notice is-dismissible"><p><?php _e('Link added.'); ?></p></div>
    7777<?php endif; ?>
    7878
  • trunk/src/wp-admin/edit-tag-form.php

    r31688 r31973  
    1212
    1313if ( empty($tag_ID) ) { ?>
    14     <div id="message" class="updated"><p><strong><?php _e( 'You did not select an item for editing.' ); ?></strong></p></div>
     14    <div id="message" class="updated notice is-dismissible"><p><strong><?php _e( 'You did not select an item for editing.' ); ?></strong></p></div>
    1515<?php
    1616    return;
  • trunk/src/wp-admin/edit-tags.php

    r31823 r31973  
    308308
    309309<?php if ( $message ) : ?>
    310 <div id="message" class="<?php echo $class; ?>"><p><?php echo $message; ?></p></div>
     310<div id="message" class="<?php echo $class; ?> notice is-dismissible"><p><?php echo $message; ?></p></div>
    311311<?php $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );
    312312endif; ?>
  • trunk/src/wp-admin/edit.php

    r31941 r31973  
    304304
    305305if ( $messages )
    306     echo '<div id="message" class="updated"><p>' . join( ' ', $messages ) . '</p></div>';
     306    echo '<div id="message" class="updated notice is-dismissible"><p>' . join( ' ', $messages ) . '</p></div>';
    307307unset( $messages );
    308308
  • trunk/src/wp-admin/includes/misc.php

    r31882 r31973  
    855855    $removable_query_args = array(
    856856        'message', 'settings-updated', 'saved',
    857         'update', 'updated','activated',
     857        'update', 'updated', 'activated',
    858858        'activate', 'deactivate', 'locked',
    859859        'deleted', 'trashed', 'untrashed',
    860860        'enabled', 'disabled', 'skipped',
     861        'spammed', 'unspammed',
    861862    );
    862863
  • trunk/src/wp-admin/includes/nav-menu.php

    r31748 r31973  
    13181318    do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
    13191319
    1320     $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';
     1320    $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';
    13211321    unset( $menu_items, $unsorted_menu_items );
    13221322
  • trunk/src/wp-admin/includes/template.php

    r31880 r31973  
    14841484    foreach ( $settings_errors as $key => $details ) {
    14851485        $css_id = 'setting-error-' . $details['code'];
    1486         $css_class = $details['type'] . ' settings-error';
     1486        $css_class = $details['type'] . ' settings-error notice is-dismissible';
    14871487        $output .= "<div id='$css_id' class='$css_class'> \n";
    14881488        $output .= "<p><strong>{$details['message']}</strong></p>";
  • trunk/src/wp-admin/js/common.js

    r31910 r31973  
    374374    $( 'div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $firstHeading );
    375375
     376    // Make notices dismissible
     377    $( '.notice.is-dismissible' ).each( function() {
     378        var $this = $( this ),
     379            $button = $( '<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>' ),
     380            btnText = commonL10n.dismiss || '';
     381
     382        // Ensure plain text
     383        $button.find( '.screen-reader-text' ).text( btnText );
     384
     385        $this.append( $button );
     386
     387        $button.on( 'click.wp-dismiss-notice', function( event ) {
     388            event.preventDefault();
     389            $this.fadeTo( 100 , 0, function() {
     390                $(this).slideUp( 100, function() {
     391                    $(this).remove();
     392                });
     393            });
     394        });
     395    });
     396
    376397    // Init screen meta
    377398    screenMeta.init();
  • trunk/src/wp-admin/link-manager.php

    r31200 r31973  
    7777<?php
    7878if ( isset($_REQUEST['deleted']) ) {
    79     echo '<div id="message" class="updated"><p>';
     79    echo '<div id="message" class="updated notice is-dismissible"><p>';
    8080    $deleted = (int) $_REQUEST['deleted'];
    8181    printf(_n('%s link deleted.', '%s links deleted', $deleted), $deleted);
  • trunk/src/wp-admin/my-sites.php

    r31200 r31973  
    5353
    5454if ( $updated ) { ?>
    55     <div id="message" class="updated"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div>
     55    <div id="message" class="updated notice is-dismissible"><p><strong><?php _e( 'Settings saved.' ); ?></strong></p></div>
    5656<?php } ?>
    5757
  • trunk/src/wp-admin/nav-menus.php

    r31951 r31973  
    232232
    233233        if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) )
    234             $messages[] = '<div id="message" class="updated"><p>' . __('The menu item has been successfully deleted.') . '</p></div>';
     234            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __('The menu item has been successfully deleted.') . '</p></div>';
    235235        break;
    236236
     
    249249
    250250        if ( is_wp_error( $deletion ) )
    251             $messages[] = '<div id="message" class="error"><p>' . $deletion->get_error_message() . '</p></div>';
     251            $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>';
    252252        else
    253             $messages[] = '<div id="message" class="updated"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>';
     253            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>';
    254254        break;
    255255
     
    262262            $deletion = wp_delete_nav_menu( $menu_id_to_delete );
    263263            if ( is_wp_error( $deletion ) ) {
    264                 $messages[] = '<div id="message" class="error"><p>' . $deletion->get_error_message() . '</p></div>';
     264                $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>';
    265265                $deletion_error = true;
    266266            }
     
    268268
    269269        if ( empty( $deletion_error ) )
    270             $messages[] = '<div id="message" class="updated"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>';
     270            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>';
    271271        break;
    272272
     
    297297
    298298                if ( is_wp_error( $_nav_menu_selected_id ) ) {
    299                     $messages[] = '<div id="message" class="error"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
     299                    $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
    300300                } else {
    301301                    $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
     
    328328                }
    329329            } else {
    330                 $messages[] = '<div id="message" class="error"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
     330                $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
    331331            }
    332332
     
    338338            $menu_title = trim( esc_html( $_POST['menu-name'] ) );
    339339            if ( ! $menu_title ) {
    340                 $messages[] = '<div id="message" class="error"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
     340                $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
    341341                $menu_title = $_menu_object->name;
    342342            }
     
    346346                if ( is_wp_error( $_nav_menu_selected_id ) ) {
    347347                    $_menu_object = $_nav_menu_selected_id;
    348                     $messages[] = '<div id="message" class="error"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
     348                    $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
    349349                } else {
    350350                    $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
     
    375375            set_theme_mod( 'nav_menu_locations', $menu_locations );
    376376
    377             $messages[] = '<div id="message" class="updated"><p>' . __( 'Menu locations updated.' ) . '</p></div>';
     377            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Menu locations updated.' ) . '</p></div>';
    378378        }
    379379        break;
  • trunk/src/wp-admin/network/settings.php

    r31658 r31973  
    115115
    116116if ( isset( $_GET['updated'] ) ) {
    117     ?><div id="message" class="updated"><p><?php _e( 'Options saved.' ) ?></p></div><?php
     117    ?><div id="message" class="updated notice is-dismissible"><p><?php _e( 'Options saved.' ) ?></p></div><?php
    118118}
    119119?>
  • trunk/src/wp-admin/network/site-info.php

    r31962 r31973  
    118118if ( ! empty( $messages ) ) {
    119119    foreach ( $messages as $msg )
    120         echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
     120        echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
    121121} ?>
    122122<form method="post" action="site-info.php?action=update-site">
  • trunk/src/wp-admin/network/site-new.php

    r31956 r31973  
    135135if ( ! empty( $messages ) ) {
    136136    foreach ( $messages as $msg )
    137         echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
     137        echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
    138138} ?>
    139139<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
  • trunk/src/wp-admin/network/site-settings.php

    r31962 r31973  
    106106if ( ! empty( $messages ) ) {
    107107    foreach ( $messages as $msg )
    108         echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
     108        echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
    109109} ?>
    110110<form method="post" action="site-settings.php?action=update-site">
  • trunk/src/wp-admin/network/site-themes.php

    r31962 r31973  
    158158if ( isset( $_GET['enabled'] ) ) {
    159159    $_GET['enabled'] = absint( $_GET['enabled'] );
    160     echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>';
     160    echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( _n( 'Theme enabled.', '%s themes enabled.', $_GET['enabled'] ), number_format_i18n( $_GET['enabled'] ) ) . '</p></div>';
    161161} elseif ( isset( $_GET['disabled'] ) ) {
    162162    $_GET['disabled'] = absint( $_GET['disabled'] );
    163     echo '<div id="message" class="updated"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>';
     163    echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( _n( 'Theme disabled.', '%s themes disabled.', $_GET['disabled'] ), number_format_i18n( $_GET['disabled'] ) ) . '</p></div>';
    164164} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
    165     echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>';
     165    echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
    166166} ?>
    167167
  • trunk/src/wp-admin/network/site-users.php

    r31962 r31973  
    202202    switch($_GET['update']) {
    203203    case 'adduser':
    204         echo '<div id="message" class="updated"><p>' . __( 'User added.' ) . '</p></div>';
     204        echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
    205205        break;
    206206    case 'err_add_member':
    207         echo '<div id="message" class="error"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
     207        echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
    208208        break;
    209209    case 'err_add_notfound':
    210         echo '<div id="message" class="error"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
     210        echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
    211211        break;
    212212    case 'promote':
    213         echo '<div id="message" class="updated"><p>' . __( 'Changed roles.' ) . '</p></div>';
     213        echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
    214214        break;
    215215    case 'err_promote':
    216         echo '<div id="message" class="error"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
     216        echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
    217217        break;
    218218    case 'remove':
    219         echo '<div id="message" class="updated"><p>' . __( 'User removed from this site.' ) . '</p></div>';
     219        echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
    220220        break;
    221221    case 'err_remove':
    222         echo '<div id="message" class="error"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
     222        echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
    223223        break;
    224224    case 'newuser':
    225         echo '<div id="message" class="updated"><p>' . __( 'User created.' ) . '</p></div>';
     225        echo '<div id="message" class="updated notice is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
    226226        break;
    227227    case 'err_new':
    228         echo '<div id="message" class="error"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
     228        echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
    229229        break;
    230230    case 'err_new_dup':
    231         echo '<div id="message" class="error"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
     231        echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
    232232        break;
    233233    }
  • trunk/src/wp-admin/network/sites.php

    r31696 r31973  
    240240
    241241    if ( ! empty( $msg ) )
    242         $msg = '<div class="updated" id="message"><p>' . $msg . '</p></div>';
     242        $msg = '<div class="updated" id="message notice is-dismissible"><p>' . $msg . '</p></div>';
    243243}
    244244
  • trunk/src/wp-admin/network/themes.php

    r31941 r31973  
    275275        $message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
    276276    }
    277     echo '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
     277    echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
    278278} elseif ( isset( $_GET['disabled'] ) ) {
    279279    $disabled = absint( $_GET['disabled'] );
     
    283283        $message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
    284284    }
    285     echo '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
     285    echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
    286286} elseif ( isset( $_GET['deleted'] ) ) {
    287287    $deleted = absint( $_GET['deleted'] );
     
    291291        $message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
    292292    }
    293     echo '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
     293    echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
    294294} elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {
    295     echo '<div id="message" class="error"><p>' . __( 'No theme selected.' ) . '</p></div>';
     295    echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
    296296} elseif ( isset( $_GET['error'] ) && 'main' == $_GET['error'] ) {
    297     echo '<div class="error"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
     297    echo '<div class="error notice is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
    298298}
    299299
  • trunk/src/wp-admin/network/user-new.php

    r31658 r31973  
    7474if ( ! empty( $messages ) ) {
    7575    foreach ( $messages as $msg )
    76         echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
     76        echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
    7777}
    7878
  • trunk/src/wp-admin/network/users.php

    r31956 r31973  
    281281if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty( $_REQUEST['action'] ) ) {
    282282    ?>
    283     <div id="message" class="updated"><p>
     283    <div id="message" class="updated notice is-dismissible"><p>
    284284        <?php
    285285        switch ( $_REQUEST['action'] ) {
  • trunk/src/wp-admin/options-permalink.php

    r31090 r31973  
    149149
    150150if ( ! empty( $_GET['settings-updated'] ) ) : ?>
    151 <div id="message" class="updated"><p><?php
     151<div id="message" class="updated notice is-dismissible"><p><?php
    152152if ( ! is_multisite() ) {
    153153    if ( $iis7_permalinks ) {
  • trunk/src/wp-admin/plugin-editor.php

    r31908 r31973  
    165165    ?>
    166166<?php if (isset($_GET['a'])) : ?>
    167  <div id="message" class="updated"><p><?php _e('File edited successfully.') ?></p></div>
     167 <div id="message" class="updated notice is-dismissible"><p><?php _e('File edited successfully.') ?></p></div>
    168168<?php elseif (isset($_GET['phperror'])) : ?>
    169169 <div id="message" class="updated"><p><?php _e('This plugin has been deactivated because your changes resulted in a <strong>fatal error</strong>.') ?></p>
  • trunk/src/wp-admin/plugins.php

    r31941 r31973  
    427427
    428428        if ( is_wp_error($delete_result) ) : ?>
    429         <div id="message" class="error"><p><?php printf( __('Plugin could not be deleted due to an error: %s'), $delete_result->get_error_message() ); ?></p></div>
     429        <div id="message" class="error notice is-dismissible"><p><?php printf( __('Plugin could not be deleted due to an error: %s'), $delete_result->get_error_message() ); ?></p></div>
    430430        <?php else : ?>
    431         <div id="message" class="updated"><p><?php _e('The selected plugins have been <strong>deleted</strong>.'); ?></p></div>
     431        <div id="message" class="updated notice is-dismissible"><p><?php _e('The selected plugins have been <strong>deleted</strong>.'); ?></p></div>
    432432        <?php endif; ?>
    433433<?php elseif ( isset($_GET['activate']) ) : ?>
    434     <div id="message" class="updated"><p><?php _e('Plugin <strong>activated</strong>.') ?></p></div>
     434    <div id="message" class="updated notice is-dismissible"><p><?php _e('Plugin <strong>activated</strong>.') ?></p></div>
    435435<?php elseif (isset($_GET['activate-multi'])) : ?>
    436     <div id="message" class="updated"><p><?php _e('Selected plugins <strong>activated</strong>.'); ?></p></div>
     436    <div id="message" class="updated notice is-dismissible"><p><?php _e('Selected plugins <strong>activated</strong>.'); ?></p></div>
    437437<?php elseif ( isset($_GET['deactivate']) ) : ?>
    438     <div id="message" class="updated"><p><?php _e('Plugin <strong>deactivated</strong>.') ?></p></div>
     438    <div id="message" class="updated notice is-dismissible"><p><?php _e('Plugin <strong>deactivated</strong>.') ?></p></div>
    439439<?php elseif (isset($_GET['deactivate-multi'])) : ?>
    440     <div id="message" class="updated"><p><?php _e('Selected plugins <strong>deactivated</strong>.'); ?></p></div>
     440    <div id="message" class="updated notice is-dismissible"><p><?php _e('Selected plugins <strong>deactivated</strong>.'); ?></p></div>
    441441<?php elseif ( 'update-selected' == $action ) : ?>
    442     <div id="message" class="updated"><p><?php _e('No out of date plugins were selected.'); ?></p></div>
     442    <div id="message" class="updated notice is-dismissible"><p><?php _e('No out of date plugins were selected.'); ?></p></div>
    443443<?php endif; ?>
    444444
  • trunk/src/wp-admin/theme-editor.php

    r31908 r31973  
    123123
    124124    if ( isset( $_GET['updated'] ) ) : ?>
    125  <div id="message" class="updated"><p><?php _e( 'File edited successfully.' ) ?></p></div>
     125 <div id="message" class="updated notice is-dismissible"><p><?php _e( 'File edited successfully.' ) ?></p></div>
    126126<?php endif;
    127127
  • trunk/src/wp-admin/themes.php

    r31915 r31973  
    130130<?php
    131131if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) : ?>
    132 <div id="message1" class="updated"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
     132<div id="message1" class="updated notice is-dismissible"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>
    133133<?php elseif ( isset($_GET['activated']) ) :
    134134        if ( isset( $_GET['previewed'] ) ) { ?>
    135         <div id="message2" class="updated"><p><?php printf( __( 'Settings saved and theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div>
     135        <div id="message2" class="updated notice is-dismissible"><p><?php printf( __( 'Settings saved and theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div>
    136136        <?php } else { ?>
    137 <div id="message2" class="updated"><p><?php printf( __( 'New theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div><?php
     137<div id="message2" class="updated notice is-dismissible"><p><?php printf( __( 'New theme activated. <a href="%s">Visit site</a>' ), home_url( '/' ) ); ?></p></div><?php
    138138        }
    139139    elseif ( isset($_GET['deleted']) ) : ?>
    140 <div id="message3" class="updated"><p><?php _e('Theme deleted.') ?></p></div>
     140<div id="message3" class="updated notice is-dismissible"><p><?php _e('Theme deleted.') ?></p></div>
    141141<?php elseif ( isset( $_GET['delete-active-child'] ) ) : ?>
    142142    <div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>
  • trunk/src/wp-admin/upload.php

    r31941 r31973  
    277277
    278278if ( !empty($message) ) { ?>
    279 <div id="message" class="updated"><p><?php echo $message; ?></p></div>
     279<div id="message" class="updated notice is-dismissible"><p><?php echo $message; ?></p></div>
    280280<?php } ?>
    281281
  • trunk/src/wp-admin/user-edit.php

    r31829 r31973  
    187187<?php } ?>
    188188<?php if ( isset($_GET['updated']) ) : ?>
    189 <div id="message" class="updated">
     189<div id="message" class="updated notice is-dismissible">
    190190    <?php if ( IS_PROFILE_PAGE ) : ?>
    191191    <p><strong><?php _e('Profile updated.') ?></strong></p>
  • trunk/src/wp-admin/user-new.php

    r31777 r31973  
    254254if ( ! empty( $messages ) ) {
    255255    foreach ( $messages as $msg )
    256         echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
     256        echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
    257257} ?>
    258258
  • trunk/src/wp-admin/users.php

    r31941 r31973  
    395395                $message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
    396396            }
    397             $messages[] = '<div id="message" class="updated"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
     397            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
    398398            break;
    399399        case 'add':
    400400            if ( isset( $_GET['id'] ) && ( $user_id = $_GET['id'] ) && current_user_can( 'edit_user', $user_id ) ) {
    401                 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'New user created. <a href="%s">Edit user</a>' ),
     401                $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( __( 'New user created. <a href="%s">Edit user</a>' ),
    402402                    esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
    403403                        self_admin_url( 'user-edit.php?user_id=' . $user_id ) ) ) ) . '</p></div>';
    404404            } else {
    405                 $messages[] = '<div id="message" class="updated"><p>' . __( 'New user created.' ) . '</p></div>';
     405                $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'New user created.' ) . '</p></div>';
    406406            }
    407407            break;
    408408        case 'promote':
    409             $messages[] = '<div id="message" class="updated"><p>' . __('Changed roles.') . '</p></div>';
     409            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __('Changed roles.') . '</p></div>';
    410410            break;
    411411        case 'err_admin_role':
    412             $messages[] = '<div id="message" class="error"><p>' . __('The current user&#8217;s role must have user editing capabilities.') . '</p></div>';
    413             $messages[] = '<div id="message" class="updated"><p>' . __('Other user roles have been changed.') . '</p></div>';
     412            $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __('The current user&#8217;s role must have user editing capabilities.') . '</p></div>';
     413            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __('Other user roles have been changed.') . '</p></div>';
    414414            break;
    415415        case 'err_admin_del':
    416             $messages[] = '<div id="message" class="error"><p>' . __('You can&#8217;t delete the current user.') . '</p></div>';
    417             $messages[] = '<div id="message" class="updated"><p>' . __('Other users have been deleted.') . '</p></div>';
     416            $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __('You can&#8217;t delete the current user.') . '</p></div>';
     417            $messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __('Other users have been deleted.') . '</p></div>';
    418418            break;
    419419        case 'remove':
    420             $messages[] = '<div id="message" class="updated fade"><p>' . __('User removed from this site.') . '</p></div>';
     420            $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __('User removed from this site.') . '</p></div>';
    421421            break;
    422422        case 'err_admin_remove':
    423             $messages[] = '<div id="message" class="error"><p>' . __("You can't remove the current user.") . '</p></div>';
    424             $messages[] = '<div id="message" class="updated fade"><p>' . __('Other users have been removed.') . '</p></div>';
     423            $messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __("You can't remove the current user.") . '</p></div>';
     424            $messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __('Other users have been removed.') . '</p></div>';
    425425            break;
    426426        }
  • trunk/src/wp-admin/widgets.php

    r31829 r31973  
    331331
    332332<?php if ( isset($_GET['message']) && isset($messages[$_GET['message']]) ) { ?>
    333 <div id="message" class="updated"><p><?php echo $messages[$_GET['message']]; ?></p></div>
     333<div id="message" class="updated notice is-dismissible"><p><?php echo $messages[$_GET['message']]; ?></p></div>
    334334<?php } ?>
    335335<?php if ( isset($_GET['error']) && isset($errors[$_GET['error']]) ) { ?>
  • trunk/src/wp-includes/script-loader.php

    r31949 r31973  
    8080    $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 );
    8181    did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array(
    82         'warnDelete' => __("You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete.")
     82        'warnDelete' => __( "You are about to permanently delete the selected items.\n  'Cancel' to stop, 'OK' to delete." ),
     83        'dismiss'    => __( 'Dismiss this notice.' ),
    8384    ) );
    8485
Note: See TracChangeset for help on using the changeset viewer.