From b2553f0cb94259fa40646db8ad10f1df0d889799 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 3 Sep 2012 15:35:22 +0000 Subject: [PATCH] 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 --- wp-admin/nav-menus.php | 11 ----------- wp-includes/script-loader.php | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/wp-admin/nav-menus.php b/wp-admin/nav-menus.php index 6b4b032389..e981575a30 100644 --- a/wp-admin/nav-menus.php +++ b/wp-admin/nav-menus.php @@ -22,19 +22,8 @@ if ( ! current_theme_supports( 'menus' ) && ! current_theme_supports( 'widgets' if ( ! current_user_can('edit_theme_options') ) 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' ); -// Metaboxes -wp_enqueue_script( 'common' ); -wp_enqueue_script( 'wp-lists' ); -wp_enqueue_script( 'postbox' ); - if ( wp_is_mobile() ) wp_enqueue_script( 'jquery-touch-punch' ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index b7feb790a7..93fd2f7556 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -434,7 +434,7 @@ function wp_default_scripts( &$scripts ) { ) ); // 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( 'noResultsFound' => _x('No results found.', 'search results'), 'warnDeleteMenu' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),