WordPress.org

Make WordPress Core

Ticket #31233: 31233.3.diff

File 31233.3.diff, 3.0 KB (added by valendesigns, 6 years ago)
  • src/wp-admin/css/common.css

    diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css
    index 6a1e9d7..7e8ca0e 100644
    div.error { 
    12801280        padding: 1px 12px;
    12811281}
    12821282
     1283div.dismiss {
     1284        overflow: hidden;
     1285}
     1286
     1287div.dismiss .hide {
     1288        float: right;
     1289}
     1290
    12831291.notice p,
    12841292div.updated p,
    12851293div.error p,
    1286 .form-table td .notice p {
     1294.form-table td .notice p,
     1295div.dismiss .hide {
    12871296        margin: 0.5em 0;
    12881297        padding: 2px;
    12891298}
  • src/wp-admin/edit-form-advanced.php

    diff --git src/wp-admin/edit-form-advanced.php src/wp-admin/edit-form-advanced.php
    index 92f56b7..bc072e4 100644
    if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create 
    410410<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
    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 dismiss"><p><?php echo $message; ?></p></div>
    414414<?php endif; ?>
    415415<div id="lost-connection-notice" class="error hidden">
    416416        <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you&#8217;re reconnected.' ); ?>
  • src/wp-admin/js/common.js

    diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js
    index dda9247..eb910d1 100644
    $(document).ready( function() { 
    373373        $firstHeading.nextAll( 'div.updated, div.error, div.notice' ).addClass( 'below-h2' );
    374374        $( 'div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $firstHeading );
    375375
     376        // Make notices dismissible
     377        $( 'div.dismiss' ).each(function(){
     378                var $this = $(this),
     379                        $anchor = $( '<a href="#" class="hide"><span class="dashicons dashicons-no"></span><span class="screen-reader-text"></span></a>' ),
     380                        hide = commonL10n.hide || '';
     381
     382                // Ensure plain text
     383                $anchor.find('.screen-reader-text').text( hide );
     384
     385                $this.prepend( $anchor );
     386
     387                $anchor.on( 'click.wp-dismiss-notice', function( event ) {
     388                        event.preventDefault();
     389                        $this.remove();
     390                });
     391        });
     392
    376393        // Init screen meta
    377394        screenMeta.init();
    378395
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index f426b9d..e51b3d5 100644
    function wp_default_scripts( &$scripts ) { 
    7979
    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                'hide'       => __( 'Hide' )
    8384        ) );
    8485
    8586        $scripts->add( 'wp-a11y', "/wp-includes/js/wp-a11y$suffix.js", array( 'jquery' ), false, 1 );