WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#21782 closed defect (bug) (invalid)

admin_print_footer_scripts action not working with wp_enqueue_script function

Reported by: alexvorn2 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.1
Component: Administration Keywords:
Focuses: 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: @SergeyBiryukov2 years ago

  • Description modified (diff)
  • Keywords 2nd-opinion needs-patch removed

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.

comment:2 in reply to: ↑ 1 @alexvorn22 years ago

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 user files through wp_enqueue_script function

Version 0, edited 2 years ago by alexvorn2 (next)

comment:3 follow-up: @SergeyBiryukov2 years 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/

comment:4 in reply to: ↑ 3 @alexvorn22 years ago

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 @SergeyBiryukov2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.