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/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
Note: See TracChangeset for help on using the changeset viewer.