Replace multiple wp_enqueue_script() calls in nav-menus.php with dependencies. props SergeyBiryukov. fixes #21777.

git-svn-id: http://core.svn.wordpress.org/trunk@21696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-09-03 15:35:22 +00:00
parent b1a748dfd8
commit b2553f0cb9
2 changed files with 1 additions and 12 deletions

View File

@ -22,19 +22,8 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets'
if ( ! current_user_can('edit_theme_options') ) if ( ! current_user_can('edit_theme_options') )
wp_die( __( 'Cheatin’ uh?' ) ); wp_die( __( 'Cheatin’ uh?' ) );
// jQuery
wp_enqueue_script( 'jquery-ui-draggable' );
wp_enqueue_script( 'jquery-ui-droppable' );
wp_enqueue_script( 'jquery-ui-sortable' );
// Nav Menu functions
wp_enqueue_script( 'nav-menu' ); wp_enqueue_script( 'nav-menu' );
// Metaboxes
wp_enqueue_script( 'common' );
wp_enqueue_script( 'wp-lists' );
wp_enqueue_script( 'postbox' );
if ( wp_is_mobile() ) if ( wp_is_mobile() )
wp_enqueue_script( 'jquery-touch-punch' ); wp_enqueue_script( 'jquery-touch-punch' );

View File

@ -434,7 +434,7 @@ function wp_default_scripts( &$scripts ) {
) ); ) );
// Navigation Menus // Navigation Menus
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array('jquery-ui-sortable') ); $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox' ) );
did_action( 'init' ) && $scripts->localize( 'nav-menu', 'navMenuL10n', array( did_action( 'init' ) && $scripts->localize( 'nav-menu', 'navMenuL10n', array(
'noResultsFound' => _x('No results found.', 'search results'), 'noResultsFound' => _x('No results found.', 'search results'),
'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ), 'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),