Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#16260 closed enhancement (worksforme)

wp_enqueue_script needs $order param

Reported by: numediaweb's profile numediaweb Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.4
Component: Themes Keywords:
Focuses: Cc:


the function wp_enqueue_script() needs another parameter that enables setting scripts load order.

This will allow more flexibility in theme design; more freedom in choosing how the code in theme templates is organized.

Change History (2)

#1 @garyc40
13 years ago

What's wrong with the third argument?

wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false )

#2 @scribu
13 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

You don't need an $order param. If you want script-b to come after script-a, just make script-a a dependency of script-b:

wp_enqueue_script( 'script-b', 'http://...', array( 'script-a' ) );

Last edited 13 years ago by scribu (previous) (diff)
Note: See TracTickets for help on using tickets.