[wp-trac] [WordPress Trac] #36091: Resolve location of files in template and stylesheet directories

WordPress Trac noreply at wordpress.org
Fri Mar 4 18:04:54 UTC 2016


#36091: Resolve location of files in template and stylesheet directories
-----------------------------+-----------------------------
 Reporter:  screamingdev     |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Themes           |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:  template         |
-----------------------------+-----------------------------
 Templates files are located in parent themes and can be extended by the
 child-theme. Unfortunately not all files can be extended or extending
 parent themes is a pain.

 Imagine the functions.php is including multiple files but you want to
 replace some. Today you need to copy the functions.php and replace the
 original file with your own one in the child-theme.
 The next theme-update might break your theme. Due to changes in the newer
 parent-theme/function.php that your child-theme/functions.php doesn't have
 the theme won't work as expected.

 For better inheritance parent and child-themes can use the new
 `get_theme_direcotry( $file )` function. It looks up if the required file
 is given in the child-theme. If so, then this one will be returned.
 Otherwise it gives you the desired path pointing to the parent-theme.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36091>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list