Make WordPress Core

Changeset 18557


Ignore:
Timestamp:
08/17/2011 06:26:41 AM (14 years ago)
Author:
azaozz
Message:

Don't call debug_backtrace() in wp_scripts_init() and wp_styles_init(), props dd32, see #11526

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.wp-scripts.php

    r18556 r18557  
    167167
    168168    if ( !$done && !is_a($wp_scripts, 'WP_Scripts') ) {
    169         if ( !did_action('after_setup_theme') ) { // last action before init
    170             $func = debug_backtrace();
    171             $trace = !empty($func[1]['function']) ? $func[1]['function'] : __FUNCTION__;
    172 
    173             _doing_it_wrong( $trace, __( '$wp_scripts should not be accessed before the "init" hook.' ), '3.3' );
    174         }
     169        if ( !did_action('after_setup_theme') ) // last action before init
     170            _doing_it_wrong( __FUNCTION__, __( '$wp_scripts should not be accessed before the "init" hook.' ), '3.3' );
    175171
    176172        $wp_scripts = new WP_Scripts();
  • trunk/wp-includes/functions.wp-styles.php

    r18556 r18557  
    174174
    175175    if ( !$done && !is_a($wp_styles, 'WP_Styles') ) {
    176         if ( !did_action('after_setup_theme') ) {
    177             $func = debug_backtrace();
    178             $trace = !empty($func[1]['function']) ? $func[1]['function'] : __FUNCTION__;
    179 
    180             _doing_it_wrong( $trace, __( '$wp_styles should not be accessed before the "init" hook.' ), '3.3' );
    181         }
     176        if ( !did_action('after_setup_theme') )
     177            _doing_it_wrong( __FUNCTION__, __( '$wp_styles should not be accessed before the "init" hook.' ), '3.3' );
    182178
    183179        $wp_styles = new WP_Styles();
Note: See TracChangeset for help on using the changeset viewer.