WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to insert a string of JavaScript variables AFTER the in_footer enqueued scripts. When I write the string via the wp_footer hook, they occur before the in_footer scripts. Is there another hook I can tie into that happens after those enqueued scripts have been written.

share|improve this question
What priorities have you tried on the hook? I think if you just dump the priority out (or maybe put it real high...one of the two, I never remember) it should adjust where it falls in relation to the enqueue. – mor7ifer Feb 4 '12 at 3:57
That did it! Want to post that as an answer so I can accept it? – hereswhatidid Feb 4 '12 at 3:59
Sure, can do! And done! – mor7ifer Feb 4 '12 at 4:02
up vote 4 down vote accepted

If you change the priority on the hook to wp_footer you should be able to shift when it's called in reference to the enqueue functions.


add_action('wp_footer', 'my_footer_hook', PHP_INT_MAX);
share|improve this answer

There's also the shutdown hook that runs last just before wp_cache_close();, but you should run the filters only until a priority of 9.

Another option would be to hook with a priority as high as possible for e.g. 9999 into the hook (priority is the 3rd arg).

share|improve this answer

Your Answer


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.