0

Possible Duplicate:
What is the preferred way to add custom javascript files to the site?

I was reading few posts here about this, but all answers are about wp_enqueue_script or something. I'm looking for solution to embed custom JavaScript variable (created by json_encode()) in footer or in header but in admin add_action 'wp_footer' and 'wp_head' are not called. How to embed custom code - not include file.

marked as duplicate by Brian Fegter, Wyck, kaiser, fuxia Sep 30 '12 at 16:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Admin area has its own hooks in header and footer, respectively:

do_action('admin_enqueue_scripts', $hook_suffix);
do_action("admin_print_styles-$hook_suffix");
do_action('admin_print_styles');
do_action("admin_print_scripts-$hook_suffix");
do_action('admin_print_scripts');
do_action("admin_head-$hook_suffix");
do_action('admin_head');

and

do_action('admin_footer', '');
do_action('admin_print_footer_scripts');
do_action("admin_footer-" . $GLOBALS['hook_suffix']);

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