[theme-reviewers] Which one get processed first? print_scripts or enqueue_scripts?

Michael Fields michael at mfields.org
Tue Jan 22 18:16:09 UTC 2013


Here's a simple way to test this:

<?php
function mfields_test_some_hooks() {
	static $i = 1;
	var_dump( $i . ' - ' . current_filter() );

	$i++;
}

add_action( 'wp_head',            'mfields_test_some_hooks' );
add_action( 'wp_print_scripts',   'mfields_test_some_hooks' );
add_action( 'wp_enqueue_scripts', 'mfields_test_some_hooks' );
?>

I get the following order:

1 - wp_enqueue_scripts
2 - wp_print_scripts
3 - wp_head


More information about the theme-reviewers mailing list