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.

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.

share|improve this question

marked as duplicate by Brian Fegter, Wyck, kaiser, toscho 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.

4  
1  
A completely detailed answer in the link @BrianFegter posted. –  Rutwick Gangurde Aug 17 '12 at 5:21
add comment

1 Answer 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']);
share|improve this answer
add comment

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