Skip to content

Commit

Permalink
Theme Editor: Hide the recommendation to create a child theme when ed…
Browse files Browse the repository at this point in the history
…iting a child theme.

Props mukesh27, davidbaumwald.
Fixes #44889.


git-svn-id: https://develop.svn.wordpress.org/trunk@45608 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
pento committed Jul 8, 2019
1 parent c6c7849 commit dd8fa6d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/wp-admin/theme-editor.php
Expand Up @@ -344,13 +344,20 @@
<h1><?php _e( 'Heads up!' ); ?></h1>
<p>
<?php
echo sprintf(
/* translators: %s: link to documentation on child themes */
__( 'You appear to be making direct edits to your theme in the WordPress dashboard. We recommend that you don&#8217;t! Editing your theme directly could break your site and your changes may be lost in future updates. If you need to tweak more than your theme&#8217;s CSS, you might want to try <a href="%s">making a child theme</a>.' ),
esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) )
);
_e( 'You appear to be making direct edits to your theme in the WordPress dashboard. We recommend that you don&#8217;t! Editing your theme directly could break your site and your changes may be lost in future updates.' );
?>
</p>
<?php
if ( ! $theme->parent() ) {
echo '<p>';
echo sprintf(
/* translators: %s: link to documentation on child themes */
__( 'If you need to tweak more than your theme&#8217;s CSS, you might want to try <a href="%s">making a child theme</a>.' ),
esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) )
);
echo '</p>';
}
?>
<p><?php _e( 'If you decide to go ahead with direct edits anyway, use a file manager to create a copy with a new name and hang on to the original. That way, you can re-enable a functional version if something goes wrong.' ); ?></p>
</div>
<p>
Expand Down

0 comments on commit dd8fa6d

Please sign in to comment.