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