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.


git-svn-id: https://develop.svn.wordpress.org/trunk@42013 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mel Choyce 2017-10-24 23:34:31 +00:00
parent 2d249b2535
commit 7201576757
1 changed files with 14 additions and 0 deletions

View File

@ -185,6 +185,20 @@ if ( $file_description != $file_show ) {
<pre><?php echo esc_html( $edit_error->get_error_message() ? $edit_error->get_error_message() : $edit_error->get_error_code() ); ?></pre>
</div>
<?php endif; ?>
<?php if ( preg_match( '/\.css$/', $file ) ) : ?>
<div id="message" class="notice-info notice">
<p><strong><?php _e( 'Did you know?' ); ?></strong></p>
<p>
<?php
echo sprintf(
/* translators: %s is a link to Custom CSS section in the Customizer. */
__( '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>.' ),
esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) )
);
?>
</p>
</div>
<?php endif; ?>
<div class="fileedit-sub">
<div class="alignleft">