[wp-trac] [WordPress Trac] #14807: Allow Theme Editor to Ignore Parent Templates

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 8 03:09:07 UTC 2010


#14807: Allow Theme Editor to Ignore Parent Templates
-----------------------------+----------------------------------------------
 Reporter:  GamajoTech       |       Owner:                 
     Type:  feature request  |      Status:  new            
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Editor           |     Version:                 
 Severity:  normal           |    Keywords:                 
-----------------------------+----------------------------------------------

Comment(by GamajoTech):

 Actually, this may not be needed, as it's technically possible already it
 seems (props to @CharlesClarkson):


 {{{
 // Add to your functions.php child theme.
 add_action('admin_notices', 'theme_files_to_edit');
 function theme_files_to_edit() {
     global $themes, $theme, $parent_file, $title;

     // Check to see if we are on the editor page.
     if ( __('Edit Themes') == $title && 'themes.php' == $parent_file ) {

         // Remove the genesis files from the files lists.
         $themes[$theme]['Template Files']   = preg_grep('|/parent-
 theme/|', $themes[$theme]['Template Files'],   PREG_GREP_INVERT);
         $themes[$theme]['Stylesheet Files'] = preg_grep('|/parent-
 theme/|', $themes[$theme]['Stylesheet Files'], PREG_GREP_INVERT);

     }
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14807#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list