From e139b9e2a02a32dfe9cd8111afa3785a76a98359 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 17 Aug 2011 06:26:41 +0000 Subject: [PATCH] Don't call debug_backtrace() in wp_scripts_init() and wp_styles_init(), props dd32, see #11526 git-svn-id: https://develop.svn.wordpress.org/trunk@18557 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.wp-scripts.php | 8 ++------ wp-includes/functions.wp-styles.php | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/wp-includes/functions.wp-scripts.php b/wp-includes/functions.wp-scripts.php index 6c0b6dde7e..fec247fe07 100644 --- a/wp-includes/functions.wp-scripts.php +++ b/wp-includes/functions.wp-scripts.php @@ -166,12 +166,8 @@ function wp_scripts_init() { static $done = false; if ( !$done && !is_a($wp_scripts, 'WP_Scripts') ) { - if ( !did_action('after_setup_theme') ) { // last action before init - $func = debug_backtrace(); - $trace = !empty($func[1]['function']) ? $func[1]['function'] : __FUNCTION__; - - _doing_it_wrong( $trace, __( '$wp_scripts should not be accessed before the "init" hook.' ), '3.3' ); - } + if ( !did_action('after_setup_theme') ) // last action before init + _doing_it_wrong( __FUNCTION__, __( '$wp_scripts should not be accessed before the "init" hook.' ), '3.3' ); $wp_scripts = new WP_Scripts(); $done = true; diff --git a/wp-includes/functions.wp-styles.php b/wp-includes/functions.wp-styles.php index 405ad006e2..e345e3f116 100644 --- a/wp-includes/functions.wp-styles.php +++ b/wp-includes/functions.wp-styles.php @@ -173,12 +173,8 @@ function wp_styles_init() { static $done = false; if ( !$done && !is_a($wp_styles, 'WP_Styles') ) { - if ( !did_action('after_setup_theme') ) { - $func = debug_backtrace(); - $trace = !empty($func[1]['function']) ? $func[1]['function'] : __FUNCTION__; - - _doing_it_wrong( $trace, __( '$wp_styles should not be accessed before the "init" hook.' ), '3.3' ); - } + if ( !did_action('after_setup_theme') ) + _doing_it_wrong( __FUNCTION__, __( '$wp_styles should not be accessed before the "init" hook.' ), '3.3' ); $wp_styles = new WP_Styles(); $done = true;