mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Don't call debug_backtrace() in wp_scripts_init() and wp_styles_init(), props dd32, see #11526
git-svn-id: http://svn.automattic.com/wordpress/trunk@18557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e5e90d732b
commit
7140ac9bf4
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user