[wp-trac] [WordPress Trac] #17805: "Child of a child" Theme: Convert include(functions.php) to include_once().
WordPress Trac
wp-trac at lists.automattic.com
Fri Jun 17 06:12:47 UTC 2011
#17805: "Child of a child" Theme: Convert include(functions.php) to include_once().
--------------------------+------------------------------
Reporter: 5ubliminal | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Themes | Version: 3.2
Severity: major | Resolution:
Keywords: has-patch |
--------------------------+------------------------------
Comment (by nacin):
You should be able to properly detect this already, without any help from
WordPress.
In your Parent theme, you need to include Root, but *only* when the parent
theme is being used as a child theme.
`if ( STYLESHEETPATH == dirname( __FILE__ ) )` in the parent theme's
functions.php. If that returns true, it's being used as a child theme.
False, being used as a parent theme.
Can also do: `if ( get_stylesheet() == 'parent_theme_name' )` -- serves
the same purpose.
Point is, you can do all of these checks. You don't need to blindly
include files. WordPress doesn't need to change for what you're trying to
do.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17805#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list