0

I'm seeing references to properties on global variables that I can't seem to find any documentation for in WordPress. For instance $wp_styles->queue and $wp_styles->registered , see this answer which contains similar code to the below:

function inspect_scripts() {
    global $wp_scripts;
    print_r($wp_scripts->queue);
}
add_action( 'wp_print_scripts', 'inspect_scripts' );

function inspect_styles() {
    global $wp_styles;
    print_r($wp_styles->queue);
}
add_action( 'wp_print_styles', 'inspect_styles' );

However when I try to find documentation for these properties in the codex for WP_Styles there is no mention of those properties. I also don't see a mention of these globals on the WordPress globals page. Where are people getting the information they need to write/use this code?

Hunter Nelson
  • 1,707
  • 3
  • 20
  • 37

1 Answers1

1

WP_Styles extends WP_Dependencies, and WP_Dependencies is where you find ->queue, ->registered, etc.

swb
  • 26
  • 4