[wp-trac] [WordPress Trac] #18985: twentyeleven_setup should use get_template_directory() instead of __FILE__
WordPress Trac
wp-trac at lists.automattic.com
Tue Oct 18 16:41:32 UTC 2011
#18985: twentyeleven_setup should use get_template_directory() instead of __FILE__
---------------------------+-----------------------------
Reporter: TomAuger | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: 3.2.1
Severity: minor | Keywords:
---------------------------+-----------------------------
Since this is a pluggable function, which would be over-ridden in the
child theme's directory, and since we want to make it as ''easy'' as
possible for new developers to extend the parent theme, consider
{{{
require( get_template_directory() . '/inc/theme-options.php' );
require( get_template_directory() . '/inc/widgets.php' );
}}}
instead of using
{{{
require( __FILE__ . '/inc/theme-options.php' );
require( __FILE__ . '/inc/widgets.php' );
}}}
__FILE__ breaks the theme and throws errors the moment twentyeleven_setup
is defined somewhere within the child theme's directory structure, whereas
{{{ get_template_directory() }}} will always point to TwentyEleven.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18985>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list