From dd8fa6dc05c9ac616b70b8a12d85a6d5c7e87b53 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 8 Jul 2019 03:14:37 +0000 Subject: [PATCH] Theme Editor: Hide the recommendation to create a child theme when editing a child theme. Props mukesh27, davidbaumwald. Fixes #44889. git-svn-id: https://develop.svn.wordpress.org/trunk@45608 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/theme-editor.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/wp-admin/theme-editor.php b/src/wp-admin/theme-editor.php index 186d54fbbe..fa06f574f3 100644 --- a/src/wp-admin/theme-editor.php +++ b/src/wp-admin/theme-editor.php @@ -344,13 +344,20 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :

making a child theme.' ), - 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’t! Editing your theme directly could break your site and your changes may be lost in future updates.' ); ?>

+ parent() ) { + echo '

'; + echo sprintf( + /* translators: %s: link to documentation on child themes */ + __( 'If you need to tweak more than your theme’s CSS, you might want to try making a child theme.' ), + esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) ) + ); + echo '

'; + } + ?>