Skip to content

Commit e0da7f0

Browse files
committed
Allow stylesheet only themes to provide functions.php. Props skeltoac. fixes WordPress#3048
git-svn-id: https://develop.svn.wordpress.org/trunk@4131 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 578fcb9 commit e0da7f0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

wp-settings.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ function timer_start() {
202202

203203
validate_current_theme();
204204
define('TEMPLATEPATH', get_template_directory());
205+
define('STYLESHEETPATH', get_stylesheet_directory());
205206

206207
// Load the default text localization domain.
207208
load_default_textdomain();
@@ -212,8 +213,10 @@ function timer_start() {
212213
$wp_locale = new WP_Locale();
213214

214215
// Load functions for active theme.
215-
if ( file_exists(TEMPLATEPATH . "/functions.php") )
216-
include(TEMPLATEPATH . "/functions.php");
216+
if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') )
217+
include(STYLESHEETPATH . '/functions.php');
218+
if ( file_exists(TEMPLATEPATH . '/functions.php') )
219+
include(TEMPLATEPATH . '/functions.php');
217220

218221
function shutdown_action_hook() {
219222
do_action('shutdown');

0 commit comments

Comments
 (0)