Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#9407 closed defect (bug) (wontfix)

Place specific hooks after general ones

Reported by: scribu Owned by:
Milestone: 2.8 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 6 years ago.

Download all attachments as: .zip

Change History (5)

@scribu6 years ago

comment:1 @scribu6 years ago

  • Cc scribu@… added

comment:2 @azaozz6 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.

comment:3 @scribu6 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.

comment:4 @scribu6 years ago

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

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

Note: See TracTickets for help on using tickets.