Make WordPress Core

Ticket #44889: 44889.patch

File 44889.patch, 2.2 KB (added by mukesh27, 7 years ago)
  • theme-editor.php

    diff -Naur old/theme-editor.php new/theme-editor.php
    old new  
    319319                                <h1><?php _e( 'Heads up!' ); ?></h1>
    320320                                <p>
    321321                                        <?php
    322                                         echo sprintf(
    323                                                 /* translators: %s: Codex URL */
    324                                                 __( '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>.' ),
    325                                                 esc_url( __( 'https://codex.wordpress.org/Child_Themes' ) )
    326                                         );
     322                                        if( $theme->parent() ) {
     323                                                _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.' );
     324                                        } else {
     325                                                echo sprintf(
     326                                                        /* translators: %s: Codex URL */
     327                                                        __( '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>.' ),
     328                                                        esc_url( __( 'https://codex.wordpress.org/Child_Themes' ) )
     329                                                );
     330                                        }
    327331                                        ?>
    328332                                </p>
    329333                                <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>
     
    340344endif; // editor warning notice
    341345
    342346include(ABSPATH . 'wp-admin/admin-footer.php' );
     347
     348//When we open http://wordpress.com/wp-admin/theme-editor.php page first time system show attached popup message in which it tell us "If you need to tweak more than your theme’s CSS, you might want to try making a child theme." but if we use child theme then also it show same message to create child theme and it create some confusion for any user so we have to hide that child theme creation message when we use child theme.
     349 No newline at end of file