WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/01/2015 10:05:17 PM (7 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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.