Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is there some way to get the $handle for each script that has been enqueued?

Is there some array that holds all the handles so that I can loop through it and do something using each $handle?

share|improve this question

1 Answer 1

up vote 10 down vote accepted

the $wp_scripts global holds all the script data:

function wpa54064_inspect_scripts() {
    global $wp_scripts;
    foreach( $wp_scripts->queue as $handle ) :
        echo $handle;
    endforeach;
}
add_action( 'wp_print_scripts', 'wpa54064_inspect_scripts' );
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.