Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 7 years ago

#9407 closed defect (bug) (wontfix)

Place specific hooks after general ones

Reported by: scribu Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Administration Keywords:
Focuses: Cc:


In admin-header, the action admin_print_styles-$hook_suffix is called before admin-print-styles.

I think this is wrong because normally you would want the general CSS to come first, so that your CSS for a specific page will override it.

The same goes for the other hooks.

Attachments (1)

action-order.patch (637 bytes) - added by scribu 13 years ago.

Download all attachments as: .zip

Change History (6)

#1 @scribu
13 years ago

  • Cc scribu@… added

#2 @azaozz
13 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Don't think that's a good idea as it may break plugins that depend on the current loading order.

You can always use do_action("admin_head-$hook_suffix"); if you need to output just a few lines of js or css to the header. If you're including a separate file it should be properly queued in the script loader listing dependencies, etc.

#3 @scribu
13 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

The current loading order was just added in WP 2.8:


A better reason why the current order is bad is that you can't use wp_enqueue_script() to load a script only on a certain admin page.

#4 @scribu
13 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

Nevermind. The current order is good. (I found out the hard way)

#5 @DrewAPicture
7 years ago

  • Milestone 2.8 deleted
Note: See TracTickets for help on using tickets.