Make WordPress Core


Ignore:
Timestamp:
04/01/2015 10:05:17 PM (10 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-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
Note: See TracChangeset for help on using the changeset viewer.