Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#9560 closed defect (bug) (wontfix)

do_action sequence in admin-footer.php

Reported by: arena's profile arena Owned by: azaozz's profile azaozz
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Administration Keywords: has-patch dev-feedback
Focuses: Cc:

Description

the current sequence is :
do_action('admin_footer', );
do_action('admin_print_footer_scripts');
do_action("admin_footer-$hook_suffix");

shouldn't it be

do_action("admin_footer-$hook_suffix");
do_action('admin_print_footer_scripts');
do_action('admin_footer', );

Attachments (1)

9560.patch (483 bytes) - added by Viper007Bond 16 years ago.

Download all attachments as: .zip

Change History (10)

@Viper007Bond
16 years ago

#1 follow-up: @Viper007Bond
16 years ago

  • Component changed from General to Administration
  • Keywords has-patch added
  • Priority changed from high to normal
  • Version set to 2.8

Yes, the generic hook should come last. Attached patch matches the order of the header.

#2 in reply to: ↑ 1 ; follow-up: @arena
16 years ago

Sorry but the right sequence should be :

do_action("admin_footer-$hook_suffix");
do_action('admin_print_footer_scripts');
do_action('admin_footer', );

#3 in reply to: ↑ 2 ; follow-up: @Viper007Bond
16 years ago

Erm, why? I went off the order that the header has it in:

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');

#4 in reply to: ↑ 3 @arena
16 years ago

Replying to Viper007Bond:

Erm, why? I went off the order that the header has it in:

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');

ok !

#5 @arena
16 years ago

Anyone to commit this patch ? thank you !

#6 @ryan
16 years ago

  • Owner changed from anonymous to azaozz

#7 @Denis-de-Bernardy
16 years ago

If I add a script in one particular page to override WP scripts, I'd *much* rather than the hook-specific hook fires after, personally.

#8 @Denis-de-Bernardy
16 years ago

  • Keywords dev-feedback added

#9 @azaozz
16 years ago

  • Milestone 2.8 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

In the footer scripts have to be printed after all content, just before the </body> tag. Also as Denis mentions running do_action("admin_footer-$hook_suffix"); last allows overwriting any previously defined js function.

Note: See TracTickets for help on using tickets.