[wp-trac] [WordPress Trac] #29618: Improve `is_child_theme` to check for a valid Template value in child stylesheet comment header

WordPress Trac noreply at wordpress.org
Wed Sep 10 17:09:53 UTC 2014


#29618: Improve `is_child_theme` to check for a valid Template value in child
stylesheet comment header
--------------------------+------------------------------
 Reporter:  lancewillett  |       Owner:
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by nacin):

 This would trigger a filesystem hit. is_child_theme() was designed to be
 super simple, and deliberately wasn't converted over to WP_Theme. In fact,
 most functions don't use WP_Theme.

 You can do `if ( wp_get_theme()->parent() )` to see if WP_Theme thinks it
 has a parent, and also `wp_get_theme()->parent()->errors()` to see if the
 parent is broken.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29618#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list