Opened 9 months ago
Closed 9 months ago
#21782 closed defect (bug) (invalid)
admin_print_footer_scripts action not working with wp_enqueue_script function
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 3.4.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by SergeyBiryukov)
the code I use:
function tt() {
wp_enqueue_script('jquery-ui-accordion');
} add_action('admin_print_footer_scripts', 'tt');
the jquery-ui-accordion is not loaded in the footer.
Change History (5)
comment:1
follow-up:
↓ 2
SergeyBiryukov — 9 months ago
- Description modified (diff)
- Keywords 2nd-opinion needs-patch removed
Replying to SergeyBiryukov:
admin_print_footer_scripts is too late for enqueueing. This is when _wp_footer_scripts() is called, so only the styles included earlier will be printed.
Use admin_footer instead.
then for what is this function? I thought it is designed for calling .js user files through wp_enqueue_script function
comment:3
follow-up:
↓ 4
SergeyBiryukov — 9 months ago
admin_print_footer_scripts action is used to print the default scripts followed by custom scripts that were earlier enqueued for the footer:
http://make.wordpress.org/core/2009/01/15/optimizing-script-loading-implementation/
Replying to SergeyBiryukov:
admin_print_footer_scripts action is used to print the default scripts followed by custom scripts that were earlier enqueued for the footer:
http://make.wordpress.org/core/2009/01/15/optimizing-script-loading-implementation/
Thanks!
comment:5
SergeyBiryukov — 9 months ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed

admin_print_footer_scripts is too late for enqueueing. This is when _wp_footer_scripts() is called, so only the styles included earlier will be printed.
Use admin_footer instead.