WordPress.org

Make WordPress Core

Changeset 42013


Ignore:
Timestamp:
10/24/2017 11:34:31 PM (2 years ago)
Author:
melchoyce
Message:

Code Editors: Add a persistent notification on CSS files, encouraging people to use the CSS panel in the Customizer instead of editing their CSS files directly.

Props helen, westonruter, nic.bertino, michelleweber.
Fixes #42100.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/theme-editor.php

    r41996 r42013  
    184184        <p><?php _e( 'There was an error while trying to update the file. You may need to fix something and try updating again.' ); ?></p>
    185185        <pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>
     186    </div>
     187<?php endif; ?>
     188<?php if ( preg_match( '/\.css$/', $file ) ) : ?>
     189    <div id="message" class="notice-info notice">
     190        <p><strong><?php _e( 'Did you know?' ); ?></strong></p>
     191        <p>
     192            <?php
     193            echo sprintf(
     194                /* translators: %s is a link to Custom CSS section in the Customizer. */
     195                __( 'There&#8217;s no need to change your CSS here &mdash; you can edit and live preview CSS changes in the <a href="%s">built-in CSS editor</a>.' ),
     196                esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )
     197            );
     198            ?>
     199        </p>
    186200    </div>
    187201<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.