[wp-trac] [WordPress Trac] #24953: Child theme functions.php only

WordPress Trac noreply at wordpress.org
Mon Aug 5 12:46:31 UTC 2013


#24953: Child theme functions.php only
-------------------------+-----------------------------
 Reporter:  wikicms      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Themes       |    Version:
 Severity:  normal       |   Keywords:  dev-feedback
-------------------------+-----------------------------
 Sometimes needed to completely disable or full rewriting the file
 functions.php parent theme. But this is impossible. Renaming or deleting
 pointless after updating themes all come back.

 I believe that we can introduce a constant defined in the file
 functions.php child theme, which will properly disable functions.php
 parent theme.

 Example:
 wp-content/themes/theme-child/functions.php

 {{{
 <?php
 define( 'CHILD_THEME_ONLY', true );
 }}}
 And little changes in wp-setting.php:

 {{{
 if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) {
         if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(
 STYLESHEETPATH . '/functions.php' ) )
                 include( STYLESHEETPATH . '/functions.php' );
         if ( ! defined('CHILD_THEME_ONLY') ) {
                 if ( file_exists( TEMPLATEPATH . '/functions.php' ) )
                         include( TEMPLATEPATH . '/functions.php' );
         }
 }
 }}}

 Sorry for my English and posting code here. I don't know how to create
 patches.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24953>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list