[theme-reviewers] Hooking wp_enqueue_script( 'comment-reply' ) into wp_head

Otto otto at ottodestruct.com
Thu Apr 21 19:26:38 UTC 2011


On Thu, Apr 21, 2011 at 2:07 PM, Chip Bennett <chip at chipbennett.net> wrote:
> ... and we have to hook into the process both
> *before* wp_enqueue_scripts fires...

Sorry, missed this reply earlier.

Short answer: No, you don't. I can think of no reason to enqueue a
script before wp_enqueue_scripts fires. The wp_enqueue_scripts is the
proper time to enqueue a script (and a style too, for that matter).
That is the only reason it exists at all.

You have to enqueue styles and scripts before wp_print_styles and
wp_print_head_scripts fire, which are both hooked to wp_head with
priorities of 8 and 9, respectively. Therefore, enqueuing at
wp_enqueue_scripts, which has an effective priority of 1, is the
correct thing to do.

-Otto


More information about the theme-reviewers mailing list