Make WordPress Core

Ticket #44889: 44889.3.diff

File 44889.3.diff, 1.7 KB (added by davidbaumwald, 7 years ago)

Updated patch per @pento's guidance

  • src/wp-admin/theme-editor.php

    diff --git a/src/wp-admin/theme-editor.php b/src/wp-admin/theme-editor.php
    index 186d54fbbe..f8aae8104c 100644
    a b if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :  
    344344                                <h1><?php _e( 'Heads up!' ); ?></h1>
    345345                                <p>
    346346                                        <?php
    347                                         echo sprintf(
    348                                                 /* translators: %s: link to documentation on child themes */
    349                                                 __( '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>.' ),
    350                                                 esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) )
    351                                         );
     347                                        _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.' );
     348
     349                                        if ( ! $theme->parent() ) {
     350                                                echo sprintf(
     351                                                        /* translators: %s: link to documentation on child themes */
     352                                                        __( '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>.' ),
     353                                                        esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) )
     354                                                );
     355                                        }
    352356                                        ?>
    353357                                </p>
    354358                                <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>