#22918 closed enhancement (invalid)
Allow to include ajax url javascript argument in the template header
Reported by: | alexvorn2 | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.5 |
Component: | Template | Keywords: | close |
Focuses: | Cc: |
Description
in the admin-header.php we have a hardcoded javascript code for showing the ajax url in the header. I think this should be included in a function and enqueue when needed, allowing to include it in the template header too using only: wp_enqueue_script('load-ajax-url');
Change History (3)
Note: See
TracTickets for help on using
tickets.
The code in question:
http://core.trac.wordpress.org/browser/tags/3.5/wp-admin/admin-header.php#L51
wp_enqueue_script()
won't be enough, we would also needwp_localize_script()
to set those values.admin-header.php
makes sense to me.ajaxurl
on the front end should also be set viawp_localize_script()
:http://codex.wordpress.org/AJAX_in_Plugins#Ajax_on_the_Viewer-Facing_Side
So,
wp_enqueue_script('load-ajax-url')
alone doesn't seem feasible.