<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13802] trunk: Various bug fixes and improvements to menu management.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13802">13802</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-03-22 19:56:16 +0000 (Mon, 22 Mar 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Various bug fixes and improvements to menu management. props ptahdunbar, see <a href="http://trac.wordpress.org/ticket/11817">#11817</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminadminajaxphp">trunk/wp-admin/admin-ajax.php</a></li>
<li><a href="#trunkwpadmincssnavmenucss">trunk/wp-admin/css/nav-menu.css</a></li>
<li><a href="#trunkwpadmincssnavmenudevcss">trunk/wp-admin/css/nav-menu.dev.css</a></li>
<li><a href="#trunkwpadminincludesnavmenuphp">trunk/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunkwpadminincludesupgradephp">trunk/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunkwpadminjsnavmenudevjs">trunk/wp-admin/js/nav-menu.dev.js</a></li>
<li><a href="#trunkwpadminjsnavmenujs">trunk/wp-admin/js/nav-menu.js</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
<li><a href="#trunkwpincludesclassesphp">trunk/wp-includes/classes.php</a></li>
<li><a href="#trunkwpincludesnavmenutemplatephp">trunk/wp-includes/nav-menu-template.php</a></li>
<li><a href="#trunkwpincludesnavmenuphp">trunk/wp-includes/nav-menu.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwpincludestaxonomyphp">trunk/wp-includes/taxonomy.php</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/admin-ajax.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -1004,7 +1004,7 @@
</span><span class="cx">                 update_user_option($user->ID, "closedpostboxes_$page", $closed);
</span><span class="cx">
</span><span class="cx">         if ( is_array($hidden) ) {
</span><del>-                $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv') ); // postboxes that are always shown
</del><ins>+                $hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv', 'manage-menu', 'create-menu') ); // postboxes that are always shown
</ins><span class="cx">                 update_user_option($user->ID, "meta-box-hidden_$page", $hidden);
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1395,6 +1395,33 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         die( '0' );
</span><ins>+case 'save-custom-link':        
+        if ( ! current_user_can('manage_links') )
+                die('-1');
+        
+        $link_name = isset( $_POST['link_name'] ) ? esc_html($_POST['link_name']) : null;
+        $link_url = isset( $_POST['link_url'] ) ? esc_url_raw($_POST['link_url']) : null;
+        
+        if ( !$link_name || !$link_url )
+                die('-1');
+        
+        $post = array(
+                'post_status' => 'draft', 'post_type' => 'nav_menu_item', 'ping_status' => 0,
+                'post_author' => $user_ID, 'post_title' => $link_name, 'post_excerpt' => '',
+                'post_parent' => 0, 'menu_order' => 0, 'post_content' => '',
+        );
+        
+        $link_id = wp_insert_post( $post );
+        
+        update_post_meta( $link_id, '_menu_item_type', 'custom' );
+        update_post_meta( $link_id, '_menu_item_object_id', (int) $link_id );
+        update_post_meta( $link_id, '_menu_item_object', 'custom' );
+        update_post_meta( $link_id, '_menu_item_target', '_self' );
+        update_post_meta( $link_id, '_menu_item_classes', '' );
+        update_post_meta( $link_id, '_menu_item_xfn', '' );
+        update_post_meta( $link_id, '_menu_item_url', $link_url );
+        
+        die( json_encode($link_id) );
</ins><span class="cx"> default :
</span><span class="cx">         do_action( 'wp_ajax_' . $_POST['action'] );
</span><span class="cx">         die('0');
</span></span></pre></div>
<a id="trunkwpadmincssnavmenucss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/nav-menu.css (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/nav-menu.css        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/css/nav-menu.css        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -1 +1 @@
</span><del>-#menu-management{clear:both;}#menu-management .inside{padding:0 10px;}#menu-container .submit{margin:0 0 10px;padding:0;}.submitdelete{font-size:11px;}#cancel-save{color:#f00;text-decoration:underline;font-size:11px;margin-left:20px;margin-top:5px;}#cancel-save:hover{background-color:#F00;color:#fff;}.button-controls{float:left;}.add-to-menu{float:right;}#manage-menu .inside{padding:0;}#create-menu-name{width:159px;}#available-links{margin:15px 0 0;}#available-links dt{display:block;}#add-custom-link .howto{font-size:11px;}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px;}.menu-item-textbox{float:right;width:220px;}.howto span{margin-top:4px;display:block;float:left;}.show-all,.hide-all{cursor:pointer;}.hide-all{display:none;}.quick-search{width:190px;}.list-wrap{display:none;clear:both;}.list-container{max-height:200px;overflow-y:auto;padding:10px 10px 5px;border:1px solid #DFDFDF;-moz-border-radius:4px;}.postbox p.submit{margin-bottom:0;}.list li{display:none;margin:0;margin-bottom:5px;}.list li .menu-item-title{cursor:pointer;display:block;}.list li .menu-item-title input{margin-right:3px;margin-top:-3px;}.list li ul li .menu-item-title{margin-left:14px;}.list li ul li ul li .menu-item-title{margin-left:28px;}.list li ul li ul li ul li .menu-item-title{margin-left:42px;}.list li ul li ul li ul li ul li .menu-item-title{margin-left:56px;}.list li ul li ul li ul li ul li ul li .menu-item-title{margin-left:70px;}.list li ul li ul li ul li ul li ul li ul li .menu-item-title{margin-left:84px;}.list li ul li ul li ul li ul li ul li ul li ul li .menu-item-title{margin-left:98px;}.list li ul li ul li ul li ul li ul li ul li ul li ul li .menu-item-title{margin-left:112px;}#menu-container .inside{padding-bottom:10px;}.menu ul{width:100%;}.menu li{margin:0;}.menu li dl dt{-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-top-left-radius:6px;border-top-right-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;border:1px solid #E6E6E6;position:relative;padding-left:10px;background-color:#f1f1f1;height:35px;line-height:35px;}.menu li dl dt:hover{cursor:move;}.menu li ul li{margin-left:20px;opacity:.7;}.menu li ul li ul li{opacity:.9;}.menu li ul li ul li ul li{opacity:.9;}.menu li ul li ul li ul li ul li{opacity:.95;}.dropzone{height:7px;margin:3px 0 3px 0;}.ui-draggable-dragging{width:600px;}.item-type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}.item-controls{font-size:11px;position:absolute;right:15px;top:-1px;}.item-controls a{text-decoration:none;}.item-controls a:hover{cursor:pointer;}.item-controls .menu-item-delete:hover{color:#f00;}#menu-item-settings{display:none;}#cancel-save{cursor:pointer;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}
</del><span class="cx">\ No newline at end of file
</span><ins>+#menu-management{clear:both;}#menu-management .inside{padding:0 10px;}#menu-container .submit{margin:0 0 10px;padding:0;}.submitdelete{font-size:11px;}#cancel-save{color:#f00;text-decoration:underline;font-size:11px;margin-left:20px;margin-top:5px;}#cancel-save:hover{background-color:#F00;color:#fff;}.list-controls{float:left;}.add-to-menu{float:right;}.button-controls{margin:10px 0;}.show-all,.hide-all{cursor:pointer;}.hide-all{display:none;}#create-menu-name{width:159px;}#manage-menu .inside{padding:0;}#available-links dt{display:block;}#add-custom-link .howto{font-size:11px;}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px;}.menu-item-textbox{float:right;width:220px;}.howto span{margin-top:4px;display:block;float:left;}.quick-search{width:190px;}.list-wrap{display:none;clear:both;margin-bottom:10px;}.list-container{max-height:200px;overflow-y:auto;padding:10px 10px 5px;border:1px solid #DFDFDF;-moz-border-radius:4px;}.postbox p.submit{margin-bottom:0;}.list li{display:none;margin:0;margin-bottom:5px;}.list li .menu-item-title{cursor:pointer;display:block;}.list li .menu-item-title input{margin-right:3px;margin-top:-3px;}.list li ul li .menu-item-title{margin-left:14px;}.list li ul li ul li .menu-item-title{margin-left:28px;}.list li ul li ul li ul li .menu-item-title{margin-left:42px;}.list li ul li ul li ul li ul li .menu-item-title{margin-left:56px;}.list li ul li ul li ul li ul li ul li .menu-item-title{margin-left:70px;}.list li ul li ul li ul li ul li ul li ul li .menu-item-title{margin-left:84px;}.list li ul li ul li ul li ul li ul li ul li ul li .menu-item-title{margin-left:98px;}.list li ul li ul li ul li ul li ul li ul li ul li ul li .menu-item-title{margin-left:112px;}#menu-container .inside{padding-bottom:10px;}.menu ul{width:100%;}.menu li{margin:0;}.menu li dl dt{-webkit-border-radius:6px;border-radius:6px;-moz-border-radius:6px;border:1px solid #E6E6E6;position:relative;padding-left:10px;background-color:#f1f1f1;height:35px;line-height:35px;}.menu li dl dt:hover{cursor:move;}.menu li ul li{margin-left:20px;opacity:.7;}.menu li ul li ul li{opacity:.9;}.menu li ul li ul li ul li{opacity:.9;}.menu li ul li ul li ul li ul li{opacity:.95;}.dropzone{height:7px;margin:3px 0 3px 0;}.ui-draggable-dragging{width:600px;}.item-type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}.item-controls{font-size:11px;position:absolute;right:15px;top:-1px;}.item-controls a{text-decoration:none;}.item-controls a:hover{cursor:pointer;}.item-controls .menu-item-delete:hover{color:#f00;}#menu-item-settings{display:none;}#cancel-save{cursor:pointer;}#cancel-save:hover{color:#fff!important;}#update-menu-item{color:#fff!important;}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important;}.button-controls:after,#menu-item-url-wrap:after,#menu-item-name-wrap:after{content:".";display:block;height:0;clear:both;visibility:hidden;}.button-controls,#menu-item-url-wrap,#menu-item-name-wrap{display:block;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincssnavmenudevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/nav-menu.dev.css (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/nav-menu.dev.css        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/css/nav-menu.dev.css        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -20,28 +20,26 @@
</span><span class="cx"> #cancel-save:hover { background-color: #FF0000; color: #fff; }
</span><span class="cx">
</span><span class="cx"> /* Button Secondary Actions */
</span><del>-.button-controls { float: left; }
</del><ins>+.list-controls { float: left; }
</ins><span class="cx"> .add-to-menu { float: right; }
</span><ins>+.button-controls { margin: 10px 0; }
+.show-all, .hide-all { cursor: pointer; }
+.hide-all { display: none; }
</ins><span class="cx">
</span><del>-#manage-menu .inside { padding: 0px 0px; }
-
</del><span class="cx"> /* Create Menu */
</span><span class="cx"> #create-menu-name { width: 159px; }
</span><ins>+#manage-menu .inside { padding: 0px 0px; }
</ins><span class="cx">
</span><span class="cx"> /* Custom Links */
</span><del>-#available-links { margin: 15px 0px 0px; }
</del><span class="cx"> #available-links dt { display: block; }
</span><span class="cx"> #add-custom-link .howto { font-size: 11px; }
</span><span class="cx"> #add-custom-link label span { display: block; float: left; margin-top: 5px; padding-right: 5px; }
</span><span class="cx"> .menu-item-textbox { float: right; width: 220px; }
</span><span class="cx"> .howto span { margin-top: 4px; display: block; float: left; }
</span><span class="cx">
</span><del>-/* Pages/Categories */
-.show-all, .hide-all { cursor: pointer; }
-.hide-all { display: none; }
-
</del><ins>+/* Menu item types */
</ins><span class="cx"> .quick-search { width: 190px; }
</span><del>-.list-wrap { display: none; clear: both; }
</del><ins>+.list-wrap { display: none; clear: both; margin-bottom: 10px; }
</ins><span class="cx"> .list-container { max-height: 200px; overflow-y: auto; padding: 10px 10px 5px; border: 1px solid #DFDFDF; -moz-border-radius: 4px; }
</span><span class="cx"> .postbox p.submit { margin-bottom: 0; }
</span><span class="cx">
</span><span class="lines">@@ -60,12 +58,12 @@
</span><span class="cx"> .list li ul li ul li ul li ul li ul li ul li ul li .menu-item-title { margin-left: 98px; }
</span><span class="cx"> .list li ul li ul li ul li ul li ul li ul li ul li ul li .menu-item-title { margin-left: 112px; }
</span><span class="cx">
</span><del>-/* Menu */
</del><ins>+/* Nav Menu */
</ins><span class="cx"> #menu-container .inside { padding-bottom: 10px; }
</span><span class="cx">
</span><span class="cx"> .menu ul { width: 100%; }
</span><span class="cx"> .menu li { margin: 0; }
</span><del>-.menu li dl dt { -webkit-border-bottom-left-radius: 6px; -webkit-border-bottom-right-radius: 6px; -webkit-border-top-left-radius: 6px; -webkit-border-top-right-radius: 6px; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; border-top-left-radius: 6px; border-top-right-radius: 6px; -moz-border-radius-bottomleft: 6px; -moz-border-radius-bottomright: 6px; -moz-border-radius-topleft: 6px; -moz-border-radius-topright: 6px; border: 1px solid #E6E6E6;position: relative; padding-left:10px; background-color: #f1f1f1; height: 35px; line-height: 35px; }
</del><ins>+.menu li dl dt { -webkit-border-radius: 6px; border-radius: 6px; -moz-border-radius: 6px; border: 1px solid #E6E6E6; position: relative; padding-left: 10px; background-color: #f1f1f1; height: 35px; line-height: 35px; }
</ins><span class="cx"> .menu li dl dt:hover { cursor: move; }
</span><span class="cx">
</span><span class="cx"> .menu li .item-title { }
</span><span class="lines">@@ -78,7 +76,7 @@
</span><span class="cx"> .dropzone { height: 7px; margin: 3px 0 3px 0; }
</span><span class="cx"> .ui-draggable-dragging { width: 600px; }
</span><span class="cx">
</span><del>-/* Menu Controls */
</del><ins>+/* Menu item controls */
</ins><span class="cx"> .item-type { text-transform: uppercase; font-size: 11px; color: #999999; padding-right: 10px; }
</span><span class="cx"> .item-controls { font-size: 11px; position: absolute; right: 15px; top: -1px; }
</span><span class="cx"> .item-controls a { text-decoration: none; }
</span><span class="lines">@@ -92,4 +90,8 @@
</span><span class="cx"> #update-menu-item { color: #fff !important; }
</span><span class="cx"> #update-menu-item:hover,
</span><span class="cx"> #update-menu-item:active,
</span><del>-#update-menu-item:focus { color: #eaf2fa !important; border-color: #13455b !important; }
</del><span class="cx">\ No newline at end of file
</span><ins>+#update-menu-item:focus { color: #eaf2fa !important; border-color: #13455b !important; }
+
+/* Clearfix */
+.button-controls:after, #menu-item-url-wrap:after, #menu-item-name-wrap:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.button-controls, #menu-item-url-wrap, #menu-item-name-wrap { display: block; }
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/nav-menu.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/includes/nav-menu.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -1,10 +1,46 @@
</span><span class="cx"> <?php
</span><ins>+/**
+ * Register nav menu metaboxes
+ *
+ * @since 3.0.0
+ **/
+function wp_nav_menu_metaboxes_setup() {
+        add_meta_box( 'add-custom-links', __('Add Custom Links'), 'wp_nav_menu_item_link_metabox', 'nav-menus', 'side', 'default' );
+        wp_nav_menu_post_type_metaboxes();
+        wp_nav_menu_taxonomy_metaboxes();
+}
</ins><span class="cx">
</span><del>-/* Register Metaboxes */
-add_meta_box( 'create-menu', __('Create Menu'), 'wp_nav_menu_create_metabox', 'menus', 'side', 'core' );
-add_meta_box( 'add-custom-links', __('Add Custom Links'), 'wp_nav_menu_item_link_metabox', 'menus', 'side', 'default' );
-wp_nav_menu_post_type_metaboxes();
-wp_nav_menu_taxonomy_metaboxes();
</del><ins>+/**
+ * Limit the amount of meta boxes to just links, pages and cats for first time users.
+ *
+ * @since 3.0.0
+ **/
+function wp_initial_nav_menu_meta_boxes() {
+        global $wp_meta_boxes;
+        
+        if ( !get_user_option( 'meta-box-hidden_nav-menus' ) && is_array($wp_meta_boxes) ) {
+                
+                $initial_meta_boxes = array( 'manage-menu', 'create-menu', 'add-custom-links', 'add-page', 'add-category' );
+                $hidden_meta_boxes = array();
+                
+                foreach ( array_keys($wp_meta_boxes['nav-menus']) as $context ) {
+                        foreach ( array_keys($wp_meta_boxes['nav-menus'][$context]) as $priority ) {
+                                foreach ( $wp_meta_boxes['nav-menus'][$context][$priority] as $box ) {
+                                        if ( in_array( $box['id'], $initial_meta_boxes ) ) {
+                                                unset( $box['id'] );
+                                        } else {
+                                                $hidden_meta_boxes[] = $box['id'];
+                                        }
+                                }
+                        }
+                }
+                $user = wp_get_current_user();
+                update_user_meta( $user->ID, 'meta-box-hidden_nav-menus', $hidden_meta_boxes );
+                
+                // returns all the hidden metaboxes to the js function: wpNavMenu.initial_meta_boxes()
+                return join( ',', $hidden_meta_boxes );
+        }
+}
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Creates metaboxes for any post type menu item.
</span><span class="lines">@@ -15,15 +51,11 @@
</span><span class="cx">         $post_types = get_post_types( array( 'public' => true ), 'object' );
</span><span class="cx">
</span><span class="cx">         if ( !$post_types )
</span><del>-                return false;
</del><ins>+                return;
</ins><span class="cx">
</span><del>-        $allowed_types = apply_filters('post_types_allowed_in_menus', array('page'));
</del><span class="cx">         foreach ( $post_types as $post_type ) {
</span><del>-                if ( !in_array($post_type->name, $allowed_types) )
-                        continue;
</del><span class="cx">                 $id = $post_type->name;
</span><del>-
-                add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $post_type->singular_label ), 'wp_nav_menu_item_post_type_metabox', 'menus', 'side', 'default', $post_type );
</del><ins>+                add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $post_type->singular_label ), 'wp_nav_menu_item_post_type_metabox', 'nav-menus', 'side', 'default', $post_type );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -36,15 +68,12 @@
</span><span class="cx">         $taxonomies = get_taxonomies( array( 'show_ui' => true ), 'object' );
</span><span class="cx">
</span><span class="cx">         if ( !$taxonomies )
</span><del>-                return false;
</del><ins>+                return;
</ins><span class="cx">
</span><del>-        $allowed_types = apply_filters('taxonomies_allowed_in_menus', array('category'));
</del><span class="cx">         foreach ( $taxonomies as $tax ) {
</span><del>-                if ( !in_array($tax->name, $allowed_types) )
-                        continue;
</del><span class="cx">                 $id = $tax->name;
</span><span class="cx">
</span><del>-                add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $tax->singular_label ), 'wp_nav_menu_item_taxonomy_metabox', 'menus', 'side', 'default', $tax );
</del><ins>+                add_meta_box( "add-{$id}", sprintf( __('Add an Existing %s'), $tax->singular_label ), 'wp_nav_menu_item_taxonomy_metabox', 'nav-menus', 'side', 'default', $tax );
</ins><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -98,11 +127,11 @@
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> */
</span><span class="cx"> function wp_nav_menu_item_link_metabox() {
</span><del>-        $args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom', 'showposts' => -1 );
</del><ins>+        // @note: hacky query, see #12660
+        $args = array( 'post_type' => 'nav_menu_item', 'post_status' => 'any', 'meta_key' => '_menu_item_type', 'numberposts' => -1, 'orderby' => 'title', );
</ins><span class="cx">
</span><span class="cx">         // @todo transient caching of these results with proper invalidation on updating links
</span><del>-        $query = new WP_Query( $args );
-
</del><ins>+        $links = get_posts( $args );
</ins><span class="cx">         ?>
</span><span class="cx">         <p id="menu-item-url-wrap">
</span><span class="cx">                 <label class="howto" for="menu-item-url">
</span><span class="lines">@@ -110,7 +139,6 @@
</span><span class="cx">                         <input id="custom-menu-item-url" name="custom-menu-item-url" type="text" class="code menu-item-textbox" value="http://" />
</span><span class="cx">                 </label>
</span><span class="cx">         </p>
</span><del>-        <br class="clear" />
</del><span class="cx">         <p id="menu-item-name-wrap">
</span><span class="cx">                 <label class="howto" for="custom-menu-item-name">
</span><span class="cx">                         <span><?php _e('Text'); ?></span>
</span><span class="lines">@@ -119,19 +147,22 @@
</span><span class="cx">         </p>
</span><span class="cx">
</span><span class="cx">         <p class="button-controls">
</span><del>-                <a class="show-all"><?php _e('View All'); ?></a>
-                <a class="hide-all"><?php _e('Hide All'); ?></a>
</del><ins>+                <span class="lists-controls">
+                        <a class="show-all"><?php _e('View All'); ?></a>
+                        <a class="hide-all"><?php _e('Hide All'); ?></a>
+                </span>
+                
+                <span class="add-to-menu">
+                        <a class="button"><?php _e('Add to Menu'); ?></a>
+                </span>
</ins><span class="cx">         </p>
</span><span class="cx">         <div id="available-links" class="list-wrap">
</span><span class="cx">                 <div class="list-container">
</span><span class="cx">                         <ul class="list">
</span><del>-                                <?php echo wp_nav_menu_get_items( $query->posts, 'custom' ); ?>
</del><ins>+                                <?php echo wp_nav_menu_get_items( $links, 'custom', 'custom' ); ?>
</ins><span class="cx">                         </ul>
</span><span class="cx">                 </div><!-- /.list-container-->
</span><span class="cx">         </div><!-- /#available-links-->
</span><del>-        <p class="add-to-menu">
-                <a class="button"><?php _e('Add to Menu'); ?></a>
-        </p>
</del><span class="cx">         <div class="clear"></div>
</span><span class="cx">         <?php
</span><span class="cx"> }
</span><span class="lines">@@ -145,24 +176,19 @@
</span><span class="cx"> * @param string $post_type The post type object.
</span><span class="cx"> */
</span><span class="cx"> function wp_nav_menu_item_post_type_metabox( $object, $post_type ) {
</span><del>-        $args = array( 'post_type' => $post_type['args']->name, 'post_status' => 'publish', 'showposts' => -1 );
</del><ins>+        $args = array( 'post_type' => $post_type['args']->name, 'numberposts' => -1, 'orderby' => 'title', );
</ins><span class="cx">
</span><del>-        if ( 'attachment' == $post_type['args']->name )
-                $args['post_status'] = 'any';
-
</del><span class="cx">         // @todo transient caching of these results with proper invalidation on updating of a post of this type
</span><del>-        $query = new WP_Query( $args );
</del><ins>+        $posts = get_posts( $args );
</ins><span class="cx">
</span><del>-        if ( !$query->posts )
</del><ins>+        if ( !$posts )
</ins><span class="cx">                 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>';
</span><span class="cx">
</span><span class="cx">         $pt_names = '';
</span><del>-        if ( is_array($query->posts) ) {
-                foreach ( $query->posts as $post ) {
</del><ins>+        if ( is_array($posts) ) {
+                foreach ( $posts as $post ) {
</ins><span class="cx">                         if ( $post->post_title ) {
</span><span class="cx">                                 $pt_names .= htmlentities( $post->post_title ) .'|';
</span><del>-                        } else {
-                                $pt_names = sprintf( __('No %s exists'), $post_type['args']->label );
</del><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -175,26 +201,29 @@
</span><span class="cx">         </p>
</span><span class="cx">
</span><span class="cx">         <p class="button-controls">
</span><del>-                <a class="show-all"><?php _e('View All'); ?></a>
-                <a class="hide-all"><?php _e('Hide All'); ?></a>
</del><ins>+                <span class="lists-controls">
+                        <a class="show-all"><?php _e('View All'); ?></a>
+                        <a class="hide-all"><?php _e('Hide All'); ?></a>
+                </span>
+                
+                <span class="add-to-menu">
+                        <a class="button"><?php _e('Add to Menu'); ?></a>
+                </span>
</ins><span class="cx">         </p>
</span><span class="cx">
</span><span class="cx">         <div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap">
</span><span class="cx">                 <div class="list-container">
</span><span class="cx">                         <ul class="list">
</span><del>-                                <?php echo isset( $error ) ? $error : wp_nav_menu_get_items( $query->posts, 'post_type', $id ); ?>
</del><ins>+                                <?php echo isset( $error ) ? $error : wp_nav_menu_get_items( $posts, 'post_type', $id ); ?>
</ins><span class="cx">                         </ul>
</span><span class="cx">                 </div><!-- /.list-container-->
</span><span class="cx">         </div><!-- /#existing-categories-->
</span><del>-        <p class="add-to-menu">
-                <a class="button-secondary"><?php _e('Add to Menu'); ?></a>
-        </p>
</del><span class="cx">         <input type="hidden" class="autocomplete" name="autocomplete-<?php echo esc_attr( $id ); ?>-names" value="<?php echo esc_js( $pt_names ); ?>" />
</span><span class="cx">         <br class="clear" />
</span><span class="cx">         <script type="text/javascript" charset="utf-8">
</span><span class="cx">                 // <![CDATA[
</span><span class="cx">                 jQuery(document).ready(function(){
</span><del>-                        wp_nav_menu_autocomplete('<?php echo esc_attr($id); ?>');
</del><ins>+                        wpNavMenu.autocomplete('<?php echo esc_attr($id); ?>');
</ins><span class="cx">                 });
</span><span class="cx">                 // ]]>
</span><span class="cx">         </script>
</span><span class="lines">@@ -227,8 +256,6 @@
</span><span class="cx">                 foreach ( $terms as $term ) {
</span><span class="cx">                         if ( $term->name ) {
</span><span class="cx">                                 $term_names .= htmlentities( $term->name ) .'|';
</span><del>-                        } else {
-                                $term_names = sprintf( __('No %s exists'), $taxonomy['args']->label );
</del><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -241,8 +268,14 @@
</span><span class="cx">         </p>
</span><span class="cx">
</span><span class="cx">         <p class="button-controls">
</span><del>-                <a class="show-all"><?php _e('View All'); ?></a>
-                <a class="hide-all"><?php _e('Hide All'); ?></a>
</del><ins>+                <span class="lists-controls">
+                        <a class="show-all"><?php _e('View All'); ?></a>
+                        <a class="hide-all"><?php _e('Hide All'); ?></a>
+                </span>
+                
+                <span class="add-to-menu">
+                        <a class="button"><?php _e('Add to Menu'); ?></a>
+                </span>
</ins><span class="cx">         </p>
</span><span class="cx">
</span><span class="cx">         <div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap">
</span><span class="lines">@@ -252,15 +285,12 @@
</span><span class="cx">                         </ul>
</span><span class="cx">                 </div><!-- /.list-container-->
</span><span class="cx">         </div><!-- /#existing-categories-->
</span><del>-        <p class="add-to-menu">
-                <a class="button-secondary"><?php _e('Add to Menu'); ?></a>
-        </p>
</del><span class="cx">         <input type="hidden" class="autocomplete" name="autocomplete-<?php echo esc_attr($id); ?>-names" value="<?php echo esc_js( $term_names ); ?>" />
</span><span class="cx">         <br class="clear" />
</span><span class="cx">         <script type="text/javascript" charset="utf-8">
</span><span class="cx">                 // <![CDATA[
</span><span class="cx">                 jQuery(document).ready(function(){
</span><del>-                        wp_nav_menu_autocomplete('<?php echo esc_attr($id); ?>');
</del><ins>+                        wpNavMenu.autocomplete('<?php echo esc_attr($id); ?>');
</ins><span class="cx">                 });
</span><span class="cx">                 // ]]>
</span><span class="cx">         </script>
</span><span class="lines">@@ -290,15 +320,20 @@
</span><span class="cx">                 if ( !isset($menu_item->post_parent) )
</span><span class="cx">                         $menu_item->post_parent = $menu_item->parent;
</span><span class="cx">
</span><del>-                // Cleanest way to get all attachements
-                if ( 'attachment' == $object )
</del><ins>+                // Get all attachements and links
+                if ( in_array($object, array( 'attachment', 'custom' )) )
</ins><span class="cx">                         $menu_item->post_parent = 0;
</span><span class="cx">
</span><span class="cx">                 if ( 0 == $menu_item->post_parent ) {
</span><span class="cx">                         // Set up the menu item
</span><span class="cx">                         $menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object );
</span><ins>+                        
+                        // No blank titles
+                        if ( empty($menu_item->title) )
+                                continue;
+                        
</ins><span class="cx">                         $attributes = ( 'backend' == $context ) ? ' id="menu-item-'. $i .'" value="'. $i .'"' : '';
</span><del>-
</del><ins>+                        
</ins><span class="cx">                         $output .= '<li'. $attributes .'>';
</span><span class="cx">                         $output .= wp_get_nav_menu_item( $menu_item, $object_type, $object );
</span><span class="cx">                         $output .= wp_get_nav_menu_sub_items( $menu_item->ID, $object_type, $object, $context );
</span></span></pre></div>
<a id="trunkwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/upgrade.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/upgrade.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/includes/upgrade.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -1105,13 +1105,26 @@
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> */
</span><span class="cx"> function upgrade_300() {
</span><del>-        global $wp_current_db_version;
</del><ins>+        global $wp_current_db_version, $wpdb;
</ins><span class="cx">
</span><span class="cx">         if ( $wp_current_db_version < 12751 ) {
</span><span class="cx">                 populate_roles_300();
</span><span class="cx">                 if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false )
</span><span class="cx">                         add_site_option( 'siteurl', '' );
</span><span class="cx">         }
</span><ins>+
+        // 3.0-alpha nav menu postmeta changes. can be removed before release
+        if ( $wp_current_db_version >= 13226 && $wp_current_db_version < 13802 ) {
+                // remove old nav menu post meta keys
+                $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key IN( 'menu_type', 'object_id', 'menu_new_window', 'menu_link', '_menu_item_append', 'menu_item_append' )" );
+                // update nav menu post meta keys to underscore prefixes
+                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_type' ), array( 'meta_key' => 'menu_item_type' ) );
+                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_object_id' ), array( 'meta_key' => 'menu_item_object_id' ) );
+                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_target' ), array( 'meta_key' => 'menu_item_target' ) );
+                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_classes' ), array( 'meta_key' => 'menu_item_classes' ) );
+                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_xfn' ), array( 'meta_key' => 'menu_item_xfn' ) );
+                $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_menu_item_url' ), array( 'meta_key' => 'menu_item_url' ) );
+        }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunkwpadminjsnavmenudevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.dev.js (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.dev.js        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/js/nav-menu.dev.js        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -1,489 +1,491 @@
</span><span class="cx"> /**
</span><del>- * WordPress Administration Custom Navigation
</del><ins>+ * WordPress Administration Navigation Menu
</ins><span class="cx"> * Interface JS functions
</span><span class="cx"> *
</span><del>- * @version 1.1.0
</del><ins>+ * @version 2.0.0
</ins><span class="cx"> *
</span><span class="cx"> * @package WordPress
</span><span class="cx"> * @subpackage Administration
</span><span class="cx"> */
</span><span class="cx">
</span><del>-function wp_nav_menu_autocomplete( id ) {
-        jQuery('#add-'+ id +' .quick-search').autocomplete(jQuery( '#add-'+ id +' .autocomplete' ).val().split('|'));
</del><ins>+var wpNavMenu;
</ins><span class="cx">
</span><del>-        jQuery('#add-'+ id +' .quick-search').result(function(event, data, formatted) {
-                jQuery('#add-'+ id +' .list-wrap').css( 'display', 'block' );
-                jQuery("#add-"+ id +" .list-wrap li:contains('" + data + "')").css( 'display', 'block' );
-                jQuery('#add-'+ id +' .show-all').hide();
-                jQuery('#add-'+ id +' .hide-all').show();
-        });
-}
</del><ins>+(function($) {
+        
+        wpNavMenu = {
+                
+                // Functions that run on init.
+                init : function() {
+                        
+                        wpNavMenu.initial_meta_boxes();
+                        
+                        wpNavMenu.drag_and_drop();
+                        
+                        // Delete AYS
+                        $('#update-nav-menu .deletion').click(function(){
+                                if ( confirm( navMenuL10n.warnDelete ) ) {
+                                        return true;
+                                } else {
+                                        return false;
+                                };
+                        });
</ins><span class="cx">
</span><del>-/**
- * Populate the thickbox window with the selected menu items
- *
- * @param int id - the id of the menu li to edit.
- */
-function wp_edit_menu_item( id ) {
-        var item_type = jQuery('#menu-item-type' + id).val();
-        var item_title = jQuery('#menu-item-title' + id).val();
-        var item_link = jQuery('#menu-item-url' + id).val();
-        var item_attr_title = jQuery('#menu-item-attr-title' + id).val();
-        var item_target = jQuery('#menu-item-target' + id).val();
-        var item_description = jQuery('#menu-item-description' + id).val();
-        var item_classes = jQuery('#menu-item-classes' + id).val();
-        var item_xfn = jQuery('#menu-item-xfn' + id).val();
</del><ins>+                        // Handle Save Button Clicks
+                        $('#update-nav-menu').submit(function(){
+                                wpNavMenu.update_post_data();
+                        });
</ins><span class="cx">
</span><del>-        // Only allow custom links to be editable.
-        if ( 'custom' != item_type )
-                jQuery( '#edit-menu-item-url' ).attr('disabled', 'disabled' );
</del><ins>+                        // Handle some return keypresses
+                        $('#create-menu-name').keypress(function(e){
+                                if ( 13 == e.keyCode ) {
+                                        $('#create-menu-button').click();
+                                        return false;
+                                }
+                        });
</ins><span class="cx">
</span><del>-        // Populate the fields for thickbox
-        jQuery( '#edit-menu-item-id' ).val(id);
-        jQuery( '#edit-menu-item-title' ).val(item_title);
-        jQuery( '#edit-menu-item-url' ).val(item_link);
-        jQuery( '#edit-menu-item-attr-title' ).val(item_attr_title);
-        jQuery( '#edit-menu-item-target' ).val(item_target);
-        jQuery( "#edit-menu-item-target option[value='" + item_target + "']" ).attr('selected', 'selected');
-        jQuery( '#edit-menu-item-description' ).val(item_description);
-        jQuery( '#edit-menu-item-classes' ).val(item_classes);
-        jQuery( '#edit-menu-item-xfn' ).val(item_xfn);
</del><ins>+                        $('#custom-menu-item-url, #custom-menu-item-name').keypress(function(e){
+                                if ( 13 == e.keyCode ) {
+                                        $('#add-custom-links a.button').click();
+                                        return false;
+                                }
+                        }).focus(function(){
+                                if ( $(this).val() == $(this).attr('defaultValue') && $(this).attr('id') != 'custom-menu-item-url' ) {
+                                        $(this).val('');
+                                }
+                        }).blur(function(){
+                                if ( $(this).val() == '' ) {
+                                        $(this).val($(this).attr('defaultValue'));
+                                }
+                        });
</ins><span class="cx">
</span><del>-        // focus
-        jQuery( '#edit-menu-item-title' ).focus();
-};
</del><ins>+                        $('#create-menu-name').focus(function(){
+                                if ( $(this).val() == $(this).attr('defaultValue') ) {
+                                        $(this).val('');
+                                }
+                        }).blur(function(){
+                                if ( $(this).val() == '' ) {
+                                        $(this).val($(this).attr('defaultValue'));
+                                }
+                        });
</ins><span class="cx">
</span><del>-/**
- * Update the values for the menu item being editing
- */
-function wp_update_menu_item() {
-        var id = jQuery('#edit-menu-item-id').val();
-        var item_title = jQuery('#edit-menu-item-title').val();
-        var item_link = jQuery('#edit-menu-item-url').val();
-        var item_attr_title = jQuery('#edit-menu-item-attr-title').val();
-        var item_target = jQuery('#edit-menu-item-target').val();
-        var item_description = jQuery('#edit-menu-item-description').val();
-        var item_classes = jQuery('#edit-menu-item-classes').val();
-        var item_xfn = jQuery('#edit-menu-item-xfn').val();
</del><ins>+                        // close postboxes that should be closed
+                        $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
</ins><span class="cx">
</span><del>-        // update menu item settings
-        jQuery('.menu #menu-item' + id).find('span.item-title').html(item_title);
-        jQuery('.menu #menu-item-title' + id).val(item_title);
-        jQuery('.menu #menu-item-url' + id).val(item_link);
-        jQuery('.menu #menu-item-attr-title' + id).val(item_attr_title);
-        jQuery('.menu #menu-item-target' + id).val(item_target);
-        jQuery('.menu #menu-item-description' + id).val(item_description);
-        jQuery('.menu #menu-item-classes' + id).val(item_classes);
-        jQuery('.menu #menu-item-xfn' + id).val(item_xfn);
</del><ins>+                        // postboxes setup
+                        postboxes.add_postbox_toggles('nav-menus');
</ins><span class="cx">
</span><del>-        jQuery('.menu #menu-item' + id + ' dt:first').animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }});
-}
</del><ins>+                        // Clear the quick search textbox
+                        $('.quick-search').click(function(){
+                                $(this).attr( 'value', '' );
+                        });
</ins><span class="cx">
</span><del>-/**
- * Removes a menu item from current menu
- *
- * @param int o - the id of the menu li to remove.
- */
-function wp_remove_menu_item( o ) {
-        var todelete = document.getElementById('menu-item' + o);
</del><ins>+                        // Quick Search submit
+                        $('.quick-search-submit').click(function(){
+                                $(this).siblings('.quick-search').search();
+                        });
</ins><span class="cx">
</span><del>-        if ( todelete ) {
-                // Give some feedback to the user
-                jQuery( todelete ).find('dt').each(function(){
-                        jQuery(this).animate( { backgroundColor: '#FF3333' }, { duration: 'normal', complete: function() { jQuery(this).parent().parent().remove() } } );
-                });
-        }
-};
</del><ins>+                        // Edit menu item
+                        $('#menu-container .item-edit').click(function(){
+                                wpNavMenu.edit_menu_item( $(this).attr('value') );
+                        });
</ins><span class="cx">
</span><del>-/**
- * Adds the item to the menu
- *
- * @param string item_db_id - The menu item's db id.
- * @param string item_object_id - The menu item's object id.
- * @param string item_type - The menu item's object type.
- * @param string item_append - The menu item's nice name.
- * @param string item_parent_id - The menu item's parent id.
- * @param string item_title - The menu item title.
- * @param string item_url - The menu item url
- * @param string item_description - The menu item description.
- * @param string item_attr_title - The title attribute.
- * @param string item_target - The target attribute.
- * @param string item_classes - Optional. Additional CSS classes for the menu item
- * @param string item_xfn - Optional. The rel attribute.
- */
-function wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) {
-        var randomnumber = wp_get_unique_menu_id();
-        var hidden = wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn );
</del><ins>+                        // Delete menu item
+                        $('#menu-container .item-delete').click(function(){
+                                wpNavMenu.remove_menu_item( $(this).attr('value') );
+                        });
</ins><span class="cx">
</span><del>-        // Adds the item in the queue
-        jQuery('.menu').append('<li id="menu-item' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">' + item_title + '</span><span class="item-controls"><span class="item-type">' + item_append + '</span><a class="item-edit thickbox" id="edit' + randomnumber + '" value="' + randomnumber +'" onClick="wp_edit_menu_item('+ randomnumber +')" title="' + navMenuL10n.thickbox + '" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">' + navMenuL10n.edit + '</a> | <a class="item-delete" id="delete' + randomnumber + '" value="' + randomnumber +'">Delete</a></span></dt></dl>' + hidden + '</li>');
</del><ins>+                        // Update menu item settings (thickbox)
+                        $('#update-menu-item').click(function(){
+                                wpNavMenu.update_menu_item();
+                                tb_remove();
+                        });
</ins><span class="cx">
</span><del>-        // Give some feedback to the user
-        jQuery( '.menu #menu-item' + randomnumber + ' dt:first' ).animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }});
</del><ins>+                        // Close thickbox
+                        $('#cancel-save').click(function(){
+                                tb_remove();
+                        });
</ins><span class="cx">
</span><del>-        // Enable drag-n-drop
-        wp_drag_and_drop();
</del><ins>+                        // Show All Button
+                        $('.show-all').click(function(e){
+                                $(e.currentTarget).parent().parent().siblings('.list-wrap').css( 'display', 'block' );
+                                $(e.currentTarget).parent().parent().siblings('.list-wrap').find('li').css( 'display', 'block' );
+                                $(e.currentTarget).hide();
+                                $(e.currentTarget).siblings('.hide-all').show();
+                        });
</ins><span class="cx">
</span><del>-        // Reload thickbox
-        tb_init('a.thickbox, area.thickbox, input.thickbox');
-};
</del><ins>+                        // Hide All Button
+                        $('.hide-all').click(function(e){
+                                $(e.currentTarget).parent().parent().siblings('.list-wrap').css( 'display', 'none' );
+                                $(e.currentTarget).parent().parent().siblings('.list-wrap').find('li').css( 'display', 'none' );
+                                $(e.currentTarget).hide();
+                                $(e.currentTarget).siblings('.show-all').show();
+                        });
</ins><span class="cx">
</span><del>-/**
- * Grabs items from the queue and adds them to the menu.
- *
- * @param string button - a reference to the button that was clicked
- */
-function wp_add_checked_items_to_menu( button ) {
-        // Grab checked items
-        var items = jQuery(button).siblings('.list-wrap').find(':checked');
</del><ins>+                        // Add menu items into the menu
+                        $('.add-to-menu').click(function(e){
+                                wpNavMenu.add_checked_items_to_menu(e.currentTarget);
+                        });
</ins><span class="cx">
</span><del>-        // If nothing was checked, cancel
-        if ( 0 == items.length )
-                return false;
</del><ins>+                        // Create a new link then add it to the menu
+                        $('#add-custom-links .add-to-menu a').click(function(e){
+                                // Add link to menu
+                                if ( $('#custom-menu-item-url').val() == $('#custom-menu-item-url').attr('defaultValue') )
+                                        return; // Do not allow "http://" submissions to go through
</ins><span class="cx">
</span><del>-        // Loop through each item, grab it's hidden data and add it to the menu.
-        jQuery(items).each(function(){
-                var item_type = jQuery(this).parent().siblings('.menu-item-type').val();
</del><ins>+                                wpNavMenu.add_custom_link( $('#custom-menu-item-name').val(), $('#custom-menu-item-url').val() );
+                                
+                                // Reset the fields back to their defaults
+                                $('#custom-menu-item-name').val($('#custom-menu-item-name').attr('defaultValue'));
+                                $('#custom-menu-item-url' ).val($('#custom-menu-item-url' ).attr('defaultValue')).focus();
+                        });
+                },
+                
+                add_custom_link : function( link_name, link_url ) {
+                        var params = {
+                                action: 'save-custom-link',
+                                link_name: link_name,
+                                link_url: link_url
+                        }
+                        
+                        $.post( ajaxurl, params, function(link_id) {
+                                if ( '-1' == link_id )
+                                        return;
</ins><span class="cx">
</span><del>-                if ( 'custom' == item_type ) {
-                        var item_attr_title = jQuery(this).parent().siblings('.menu-item-attr-title').val();
-                        var item_target = jQuery(this).parent().siblings('.menu-item-target').val();
-                        var item_classes = jQuery(this).parent().siblings('.menu-item-classes').val();
-                        var item_xfn = jQuery(this).parent().siblings('.menu-item-xfn').val();
-                } else {
-                        var item_attr_title = '';
-                        var item_target = '_self';
-                        var item_classes = '';
-                        var item_xfn = '';
-                };
</del><ins>+                                wpNavMenu.add_to_menu( link_id, link_id, 'custom', 'custom', navMenuL10n.custom, 0, link_name, link_url, '', '', '_self', '', '' );
+                        }, 'json');
+                },
+                
+                /**
+                 * In combination with the php function wp_initial_nav_menu_meta_boxes(),
+                 * this function limits the metaboxes for first time users to just links, pages and cats.
+                 */
+                initial_meta_boxes : function() {
+                        var hidden = $('#hidden-metaboxes').val().split( ',' );
</ins><span class="cx">
</span><del>-                var item_db_id = jQuery(this).parent().siblings('.menu-item-db-id').val();
-                var item_object_id = jQuery(this).parent().siblings('.menu-item-object-id').val();
-                var item_append = jQuery(this).parent().siblings('.menu-item-append').val();
-                var item_parent_id = jQuery(this).parent().siblings('.menu-item-parent-id').val();
-                var item_title = jQuery(this).parent().siblings('.menu-item-title').val();
-                var item_url = jQuery(this).parent().siblings('.menu-item-url').val();
-                var item_description = jQuery(this).parent().siblings('.menu-item-description').val();
</del><ins>+                        if ( '' != hidden ) {
+                                for ( var i = 0; i < hidden.length; i++ ) {
+                                        $( '#' + hidden[i] ).attr( 'style', 'display: none;' );
+                                        $( '#' + hidden[i] + '-hide' ).attr( 'checked', false );
+                                };
+                        };
+                },
+                
+                // Makes the menu items drag and droppable.
+                drag_and_drop : function() {
+                        // Make sure all li's have dropzones
+                        $('.menu li').each(function(){
+                                if ( !$(this).children('.dropzone').attr('class') ) {
+                                        $(this).prepend('<div class="dropzone"></div>');
+                                };
+                        });
</ins><span class="cx">
</span><del>-                if ( undefined == item_description ) {
-                        item_description = '';
-                };
</del><ins>+                        // make menu item draggable
+                        $('.menu li').draggable({
+                                handle: ' > dl',
+                                opacity: .8,
+                                addClasses: false,
+                                helper: 'clone',
+                                zIndex: 100
+                        });
</ins><span class="cx">
</span><del>-                // Add the menu item to the menu
-                wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn );
</del><ins>+                        // make menu item droppable
+                        $('.menu li dl, .menu li .dropzone').droppable({
+                                accept: '.menu li',
+                                tolerance: 'pointer',
+                                drop: function(e, ui) {
+                                        var li = $(this).parent();
+                                        var child = !$(this).hasClass('dropzone');
</ins><span class="cx">
</span><del>-                // uncheck the menu item in the list
-                jQuery(this).attr( 'checked', false );
-        });
-};
</del><ins>+                                        // Append UL to first child
+                                        if ( child && li.children('ul').length == 0 ) {
+                                                li.append( '<ul class="sub-menu" />' );
+                                        }
+                                        // Make it draggable
+                                        if ( child ) {
+                                                li.children('ul').append( ui.draggable );
+                                        } else {
+                                                li.before( ui.draggable );
+                                        }
</ins><span class="cx">
</span><del>-/**
- * Makes the menu items drag and droppable.
- */
-function wp_drag_and_drop() {
-        // Make sure all li's have dropzones
-        jQuery('.menu li').each(function(){
-                if ( !jQuery(this).children('.dropzone').attr('class') ) {
-                        jQuery(this).prepend('<div class="dropzone"></div>');
-                };
-        });
</del><ins>+                                        li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
</ins><span class="cx">
</span><del>-        // make menu item draggable
-        jQuery('.menu li').draggable({
-                handle: ' > dl',
-                opacity: .8,
-                addClasses: false,
-                helper: 'clone',
-                zIndex: 100
-        });
</del><ins>+                                        var draggablevalue = ui.draggable.attr('value');
+                                        var droppablevalue = li.attr('value');
</ins><span class="cx">
</span><del>-        // make menu item droppable
-        jQuery('.menu li dl, .menu li .dropzone').droppable({
-                accept: '.menu li',
-                tolerance: 'pointer',
-                drop: function(e, ui) {
-                        var li = jQuery(this).parent();
-                        var child = !jQuery(this).hasClass('dropzone');
</del><ins>+                                        li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
+                                        $(this).parent().find('dt').removeAttr('style');
+                                        $(this).parent().find('div:first').removeAttr('style');
</ins><span class="cx">
</span><del>-                        // Append UL to first child
-                        if ( child && li.children('ul').length == 0 ) {
-                                li.append( '<ul class="sub-menu" />' );
-                        }
-                        // Make it draggable
-                        if ( child ) {
-                                li.children('ul').append( ui.draggable );
-                        } else {
-                                li.before( ui.draggable );
-                        }
-
-                        li.find('dl,.dropzone').css({ backgroundColor: '', borderColor: '' });
-
-                        var draggablevalue = ui.draggable.attr('value');
-                        var droppablevalue = li.attr('value');
-
-                        li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue);
-                        jQuery(this).parent().find('dt').removeAttr('style');
-                        jQuery(this).parent().find('div:first').removeAttr('style');
-
</del><ins>+                                },
+                                over: function(e) {
+                                 // Add child
+                                        if ( $(this).attr('class') == 'dropzone ui-droppable' ) {
+                                         $(this).parent().find('div:first').css({ background: '#f5f5f5', border: '1px dashed #bbb', margin: '10px 0px', height: '40px' });
+                                 }
+                                        // Add above
+                                 else if ( $(this).attr('class') == 'ui-droppable' ) {
+                                                $(this).parent().find('dt:first').css('background', '#d8d8d8');
+                                 } else {
+                                                // Do nothing
+                                 }
+                         },
+                         out: function() {
+                         $(this).parent().find('dt').removeAttr('style');
+                         $(this).parent().find('div:first').removeAttr('style');
+                         $(this).filter('.dropzone').css({ borderColor: '' });
+                         }
+                        });
</ins><span class="cx">                 },
</span><del>-                over: function() {
-                         // Add child
-                         if ( jQuery(this).attr('class') == 'dropzone ui-droppable' ) {
-                                 jQuery(this).parent().find('div:first').css('background', 'none').css('height', '50px');
-                         }
-                         // Add above
-                         else if ( jQuery(this).attr('class') == 'ui-droppable' ) {
-                                 jQuery(this).parent().find('dt:first').css('background', '#d8d8d8');
-                         } else {
-                                        // do nothing
-                         }
-                         var parentid = jQuery(this).parent().attr('id');
</del><ins>+        
+                // Prepares menu items for POST.
+                update_post_data : function() {
+                        var i = 0; // counter
</ins><span class="cx">
</span><del>-                 },
-                 out: function() {
-                 jQuery(this).parent().find('dt').removeAttr('style');
-                 jQuery(this).parent().find('div:first').removeAttr('style');
-                 jQuery(this).filter('.dropzone').css({ borderColor: '' });
-                 }
-                }
-        );
-}
</del><ins>+                        $('.menu li').each(function(){
+                                i = i + 1; // the menu order for each item
</ins><span class="cx">
</span><del>-/**
- * Prepares menu items for POST.
- */
-function wp_update_post_data() {
-        var i = 0;
</del><ins>+                                var j = $(this).attr('value'); // reference to the current menu item (e.g. li#menu-item + j)
</ins><span class="cx">
</span><del>-         jQuery('.menu li').each(function(i) {
-                i = i + 1;
-         var j = jQuery(this).attr('value');
</del><ins>+                                // Grab the menu item id
+                                var id = $(this).children('input[name=menu-item-db-id[]]').val();
</ins><span class="cx">
</span><del>-         jQuery(this).find('#menu-item-position' + j).attr('value', i);
-         jQuery(this).attr('id','menu-item' + i);
-         jQuery(this).attr('value', i);
</del><ins>+                                // Update the li value to equal the menu order
+                                $(this).attr('value', i);
</ins><span class="cx">
</span><del>-         jQuery(this).find('#menu-item-db-id' + j).attr('id','menu-item-db-id' + i);
-         jQuery(this).find('#menu-item-object-id' + j).attr('id','menu-item-object-id' + i);
-                jQuery(this).find('#menu-item-append' + j).attr('id', 'menu-item-append' + i);
-                jQuery(this).find('#menu-item-type' + j).attr('id', 'menu-item-type' + i);
-                jQuery(this).find('#menu-item-position' + j).attr('id', 'menu-item-position' + i);
</del><ins>+                                // Update the position
+                                $(this).children('input[name=menu-item-position[]]').attr( 'value', i );
</ins><span class="cx">
</span><del>-         var p = jQuery(this).find('#menu-item-parent-id' + j).parent().parent().parent().attr('value');
-                jQuery(this).find('#menu-item-parent-id' + j).attr('id','menu-item-parent-id' + i);
-                if (p) {
-                        // Do nothing
-                } else {
-                        // reset p to be top level
-                        p = 0;
-                }
-                jQuery(this).find('#menu-item-parent-id' + j).attr('value', p);
</del><ins>+                                // Update the parent id
+                                var pid = $(this).parent('.sub-menu').siblings('input[name=menu-item-object-id[]]').val();
+                                
+                                if ( undefined == pid ) {
+                                        pid = 0;
+                                };
</ins><span class="cx">
</span><del>-                jQuery(this).find('#menu-item-title' + j).attr('id','menu-item-title' + i);
-                jQuery(this).find('#menu-item-url' + j).attr('id','menu-item-url' + i);
-                jQuery(this).find('#menu-item-description' + j).attr('id','menu-item-description' + i);
-                jQuery(this).find('#menu-item-classes' + j).attr('id','menu-item-classes' + i);
-                jQuery(this).find('#menu-item-xfn' + j).attr('id','menu-item-xfn' + i);
-                jQuery(this).find('#menu-item-description' + j).attr('id','menu-item-description' + i);
-                jQuery(this).find('#menu-item-attr-title' + j).attr('id','menu-item-attr-title' + i);
-                jQuery(this).find('#menu-item-target' + j).attr('id','menu-item-target' + i);
</del><ins>+                                $(this).children('input[name=menu-item-parent-id[]]').attr( 'value', pid );
</ins><span class="cx">
</span><del>-                jQuery('#li-count').attr( 'value', i );
- });
-};
</del><ins>+                                // Update the menu item count
+                                $('#li-count').attr( 'value', i );
+                        });
+                },
+                
+                /**
+                 * Enables autocomplete for nav menu types.
+                 *
+                 * @param int id - the id of the menu item type.
+                 */
+                autocomplete : function( id ) {
+                        $('#add-'+ id +' .quick-search').autocomplete( $( '#add-'+ id +' .autocomplete' ).val().split('|') );
</ins><span class="cx">
</span><del>-/**
- * Gets a unique number based on how many items are in the menu
- */
-function wp_get_unique_menu_id() {
-        var count = jQuery('.menu li').length + 1;
-        var randomnumber = count;
-        var validatetest = 0;
</del><ins>+                        $('#add-'+ id +' .quick-search').result(function( event, data, formatted ) {
+                                $('#add-'+ id +' .list-wrap').css( 'display', 'block' );
+                                $("#add-"+ id +" .list-wrap li:contains('" + data + "')").css( 'display', 'block' );
+                                $('#add-'+ id +' .show-all').hide();
+                                $('#add-'+ id +' .hide-all').show();
+                        });
+                },
+                
+                /**
+                 * Populate the thickbox window with the selected menu items
+                 *
+                 * @param int id - the id of the menu item to edit.
+                 */
+                edit_menu_item : function( id ) {
+                        var item_type = $('#menu-item-' + id).children('input[name=menu-item-type[]]').val();
+                        var item_title = $('#menu-item-' + id).children('input[name=menu-item-title[]]').val();
+                        var item_link = $('#menu-item-' + id).children('input[name=menu-item-url[]]').val();
+                        var item_attr_title = $('#menu-item-' + id).children('input[name=menu-item-attr-title[]]').val();
+                        var item_target = $('#menu-item-' + id).children('input[name=menu-item-target[]]').val();
+                        var item_description = $('#menu-item-' + id).children('input[name=menu-item-description[]]').val();
+                        var item_classes = $('#menu-item-' + id).children('input[name=menu-item-classes[]]').val();
+                        var item_xfn = $('#menu-item-' + id).children('input[name=menu-item-xfn[]]').val();
</ins><span class="cx">
</span><del>-        try {
-                var test = document.getElementById( 'menu-' + randomnumber.toString() ).value;
-        }
-        catch ( err ) {
-                validatetest = 1;
-        }
</del><ins>+                        // Only allow custom links to be editable.
+                        if ( 'custom' != item_type )
+                                $( '#edit-menu-item-url' ).attr('disabled', 'disabled' );
</ins><span class="cx">
</span><del>-        while ( validatetest == 0 ) {
-                randomnumber = randomnumber + 1;
-                try {
-                        var test2 = document.getElementById( 'menu-' + randomnumber.toString() ).value;
-                }
-                catch ( err ) {
-                        validatetest = 1;
-                }
-        }
-        return randomnumber;
-}
</del><ins>+                        // Populate the fields for thickbox
+                        $( '#edit-menu-item-id' ).val(id);
+                        $( '#edit-menu-item-title' ).val(item_title);
+                        $( '#edit-menu-item-url' ).val(item_link);
+                        $( '#edit-menu-item-attr-title' ).val(item_attr_title);
+                        $( '#edit-menu-item-target' ).val(item_target);
+                        $( "#edit-menu-item-target option[value='" + item_target + "']" ).attr('selected', 'selected');
+                        $( '#edit-menu-item-description' ).val(item_description);
+                        $( '#edit-menu-item-classes' ).val(item_classes);
+                        $( '#edit-menu-item-xfn' ).val(item_xfn);
</ins><span class="cx">
</span><del>-/**
- * Returns all the nessecary hidden inputs for each menu item.
- *
- * @param string item_db_id - The menu item's db id.
- * @param string item_object_id - The menu item's object id.
- * @param string item_type - The menu item's object type.
- * @param string item_append - The menu item's nice name.
- * @param string item_parent_id - The menu item's parent id.
- * @param string item_title - The menu item title.
- * @param string item_url - The menu item url
- * @param string item_description - The menu item description.
- * @param string item_attr_title - The title attribute.
- * @param string item_target - The target attribute.
- * @param string item_classes - Optional. Additional CSS classes for the menu item
- * @param string item_xfn - Optional. The rel attribute.
- */
-function wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) {
-        var hidden = '';
</del><ins>+                        // @todo: focus on #edit-menu-item-title
+                },
+                
+                /**
+                 * Update the values for the menu item being editing
+                 */
+                update_menu_item : function() {
+                        var id = $('#edit-menu-item-id').val();
+                        var item_title = $('#edit-menu-item-title').val();
+                        var item_link = $('#edit-menu-item-url').val();
+                        var item_attr_title = $('#edit-menu-item-attr-title').val();
+                        var item_target = $('#edit-menu-item-target').val();
+                        var item_description = $('#edit-menu-item-description').val();
+                        var item_classes = $('#edit-menu-item-classes').val();
+                        var item_xfn = $('#edit-menu-item-xfn').val();
</ins><span class="cx">
</span><del>-        hidden += '<input type="hidden" name="menu-item-db-id[]" id="menu-item-db-id' + randomnumber + '" value="' + item_db_id + '" />';
-        hidden += '<input type="hidden" name="menu-item-object-id[]" id="menu-item-object-id' + randomnumber + '" value="' + item_object_id + '" />';
-        hidden += '<input type="hidden" name="menu-item-type[]" id="menu-item-type' + randomnumber + '" value="' + item_type + '" />';
-        hidden += '<input type="hidden" name="menu-item-append[]" id="menu-item-append' + randomnumber + '" value="' + item_append + '" />';
-        hidden += '<input type="hidden" name="menu-item-parent-id[]" id="menu-item-parent-id' + randomnumber + '" value="' + item_parent_id + '" />';
-        hidden += '<input type="hidden" name="menu-item-position[]" id="menu-item-position' + randomnumber + '" value="' + randomnumber + '" />';
-        hidden += '<input type="hidden" name="menu-item-title[]" id="menu-item-title' + randomnumber + '" value="' + item_title + '" />';
-        hidden += '<input type="hidden" name="menu-item-attr-title[]" id="menu-item-attr-title' + randomnumber + '" value="' + item_attr_title + '" />';
-        hidden += '<input type="hidden" name="menu-item-url[]" id="menu-item-url' + randomnumber + '" value="' + item_url + '" />';
-        hidden += '<input type="hidden" name="menu-item-target[]" id="menu-item-target' + randomnumber + '" value="' + item_target + '" />';
-        hidden += '<input type="hidden" name="menu-item-description[]" id="menu-item-description' + randomnumber + '" value="' + item_description + '" />';
-        hidden += '<input type="hidden" name="menu-item-classes[]" id="menu-item-classes' + randomnumber + '" value="' + item_classes + '" />';
-        hidden += '<input type="hidden" name="menu-item-xfn[]" id="menu-item-xfn' + randomnumber + '" value="' + item_xfn + '" />';
</del><ins>+                        // update menu item settings
+                        $('.menu #menu-item-' + id).find('span.item-title:first').html(item_title);
</ins><span class="cx">
</span><del>-        return hidden;
-}
</del><ins>+                        $('#menu-item-' + id).children('input[name=menu-item-title[]]').val(item_title);
+                        $('#menu-item-' + id).children('input[name=menu-item-url[]]').val(item_link);
+                        $('#menu-item-' + id).children('input[name=menu-item-attr-title[]]').val(item_attr_title);
+                        $('#menu-item-' + id).children('input[name=menu-item-target[]]').val(item_target);
+                        $('#menu-item-' + id).children('input[name=menu-item-description[]]').val(item_description);
+                        $('#menu-item-' + id).children('input[name=menu-item-classes[]]').val(item_classes);
+                        $('#menu-item-' + id).children('input[name=menu-item-xfn[]]').val(item_xfn);
</ins><span class="cx">
</span><del>-/**
- * WordPress Administration Custom Navigation
- * Interface $ functions
- *
- * @version 2.0.0
- *
- * @package WordPress
- * @subpackage Administration
- */
</del><ins>+                        $('.menu #menu-item-' + id + ' dt:first').animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { $(this).css( 'backgroundColor', '' ); }});
+                },
+                
+                /**
+                 * Removes a menu item from current menu
+                 *
+                 * @param int id - the id of the menu item to remove.
+                 */
+                remove_menu_item : function( id ) {
+                        var todelete = $('#menu-item-' + id);
</ins><span class="cx">
</span><del>-/**
- * Init Functions
- */
-jQuery(document).ready(function($){
</del><ins>+                        if ( todelete ) {
+                                // Give some feedback to the user
+                                $( todelete ).find('dt').each(function(){
+                                        $(this).animate( { backgroundColor: '#FF3333' }, { duration: 'normal', complete: function() { $(this).parent().parent().remove() } } );
+                                });
+                        }
+                },
+                
+                /**
+                 * Adds the item to the menu
+                 *
+                 * @param string item_db_id - The menu item's db id.
+                 * @param string item_object_id - The menu item's object id.
+                 * @param string item_object - The menu item's object name.
+                 * @param string item_type - The menu item's object type.
+                 * @param string item_append - The menu item's nice name.
+                 * @param string item_parent_id - The menu item's parent id.
+                 * @param string item_title - The menu item title.
+                 * @param string item_url - The menu item url
+                 * @param string item_description - The menu item description.
+                 * @param string item_attr_title - The title attribute.
+                 * @param string item_target - The target attribute.
+                 * @param string item_classes - Optional. Additional CSS classes for the menu item
+                 * @param string item_xfn - Optional. The rel attribute.
+                 */
+                add_to_menu : function( item_db_id, item_object_id, item_object, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) {
+                        var randomnumber = $('.menu li').length + 1;
+                        var hidden = wpNavMenu.get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_object, item_type, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn );
+                        
+                        // Adds the item to the menu
+                        $('.menu').append('<li id="menu-item-' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">' + item_title + '</span><span class="item-controls"><span class="item-type">' + item_append + '</span><a class="item-edit thickbox" id="edit' + randomnumber + '" value="' + randomnumber +'" onclick="wpNavMenu.edit_menu_item('+ randomnumber +');" title="' + navMenuL10n.thickbox + '" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">' + navMenuL10n.edit + '</a> | <a class="item-delete" id="delete' + randomnumber + '" value="' + randomnumber +'" onclick="wpNavMenu.remove_menu_item('+ randomnumber +');">Delete</a></span></dt></dl>' + hidden + '</li>');
</ins><span class="cx">
</span><del>-        wp_drag_and_drop();
</del><ins>+                        // Give some feedback to the user
+                        $( '.menu #menu-item-' + randomnumber + ' dt:first' ).animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { $(this).css( 'backgroundColor', '' ); }});
</ins><span class="cx">
</span><del>-        // Delete AYS
-        $('#update-nav-menu .deletion').click(function(){
-                if ( confirm( navMenuL10n.warnDelete ) ) {
-                        return true;
-                } else {
-                        return false;
-                };
-        });
</del><ins>+                        // Enable drag-n-drop
+                        wpNavMenu.drag_and_drop();
</ins><span class="cx">
</span><del>-        // Handle Save Button Clicks
-        $('#save_menu').click(function(){
-                return wp_update_post_data();
-        });
</del><ins>+                        // Reload thickbox
+                        tb_init('a.thickbox, area.thickbox, input.thickbox');
+                },
+                
+                /**
+                 * Grabs items from the queue and adds them to the menu.
+                 *
+                 * @param string button - a reference to the button that was clicked
+                 */
+                add_checked_items_to_menu : function( button ) {
+                        // Grab checked items
+                        var items = $(button).parent().siblings('.list-wrap').find(':checked');
</ins><span class="cx">
</span><del>-        // Handle some return keypresses
-        $('#create-menu-name').keypress(function(e){
-                if ( 13 == e.keyCode ) {
-                        $('#create-menu-button').click();
-                        return false;
-                }
-        });
</del><ins>+                        // If nothing was checked, cancel
+                        if ( 0 == items.length )
+                                return false;
</ins><span class="cx">
</span><del>-        $('#custom-menu-item-url, #custom-menu-item-name').keypress(function(e){
-                if ( 13 == e.keyCode ) {
-                        $('#add-custom-links a.button').click();
-                        return false;
-                }
-        }).focus(function(){
-                if ( $(this).val() == $(this).attr('defaultValue') && $(this).attr('id') != 'custom-menu-item-url' ) {
-                        $(this).val('');
-                }
-        }).blur(function(){
-                if ( $(this).val() == '' ) {
-                        $(this).val($(this).attr('defaultValue'));
-                }
-        });
</del><ins>+                        // Loop through each item, grab it's hidden data and add it to the menu.
+                        $(items).each(function(){
+                                var item_type = $(this).parent().siblings('.menu-item-type').val();
</ins><span class="cx">
</span><del>-        $('#create-menu-name').focus(function(){
-                if ( $(this).val() == $(this).attr('defaultValue') ) {
-                        $(this).val('');
-                }
-        }).blur(function(){
-                if ( $(this).val() == '' ) {
-                        $(this).val($(this).attr('defaultValue'));
-                }
-        });
</del><ins>+                                if ( 'custom' == item_type ) {
+                                        var item_attr_title = $(this).parent().siblings('.menu-item-attr-title').val();
+                                        var item_target = $(this).parent().siblings('.menu-item-target').val();
+                                        var item_classes = $(this).parent().siblings('.menu-item-classes').val();
+                                        var item_xfn = $(this).parent().siblings('.menu-item-xfn').val();
+                                } else {
+                                        var item_attr_title = '';
+                                        var item_target = '_self';
+                                        var item_classes = '';
+                                        var item_xfn = '';
+                                };
</ins><span class="cx">
</span><del>-        // close postboxes that should be closed
-        $('.if-js-closed').removeClass('if-js-closed').addClass('closed');
</del><ins>+                                var item_db_id = $(this).parent().siblings('.menu-item-db-id').val();
+                                var item_object_id = $(this).parent().siblings('.menu-item-object-id').val();
+                                var item_object = $(this).parent().siblings('.menu-item-object').val();
+                                var item_append = $(this).parent().siblings('.menu-item-append').val();
+                                var item_parent_id = $(this).parent().siblings('.menu-item-parent-id').val();
+                                var item_title = $(this).parent().siblings('.menu-item-title').val();
+                                var item_url = $(this).parent().siblings('.menu-item-url').val();
+                                var item_description = $(this).parent().siblings('.menu-item-description').val();
</ins><span class="cx">
</span><del>-        // postboxes setup
-        postboxes.add_postbox_toggles('menus');
</del><ins>+                                if ( undefined == item_description ) {
+                                        item_description = '';
+                                };
</ins><span class="cx">
</span><del>-        // Clear the quick search textbox
-        $('.quick-search').click(function(){
-                $(this).attr( 'value', '' );
-        });
</del><ins>+                                if ( undefined == item_attr_title ) {
+                                        item_attr_title = '';
+                                };
</ins><span class="cx">
</span><del>-        // Quick Search submit
-        $('.quick-search-submit').click(function(){
-                $(this).siblings('.quick-search').search();
-        });
</del><ins>+                                // Add the menu item to the menu
+                                wpNavMenu.add_to_menu( item_db_id, item_object_id, item_object, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn );
</ins><span class="cx">
</span><del>-        // Edit menu item
-        $('#menu-container .item-edit').click(function(){
-                return wp_edit_menu_item( $(this).attr('value') );
-        });
</del><ins>+                                // uncheck the menu item in the list
+                                $(this).attr( 'checked', false );
+                        });
+                },
+                
+                /**
+                 * Returns all the nessecary hidden inputs for each menu item.
+                 *
+                 * @param string item_db_id - The menu item's db id.
+                 * @param string item_object_id - The menu item's object id.
+                 * @param string item_object - The menu item's object name.
+                 * @param string item_type - The menu item's object type.
+                 * @param string item_append - The menu item's nice name.
+                 * @param string item_parent_id - The menu item's parent id.
+                 * @param string item_title - The menu item title.
+                 * @param string item_url - The menu item url
+                 * @param string item_description - The menu item description.
+                 * @param string item_attr_title - The title attribute.
+                 * @param string item_target - The target attribute.
+                 * @param string item_classes - Optional. Additional CSS classes for the menu item
+                 * @param string item_xfn - Optional. The rel attribute.
+                 */
+                get_hidden_inputs : function( randomnumber, item_db_id, item_object_id, item_object, item_type, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) {
+                        var hidden = '';
</ins><span class="cx">
</span><del>-        // Delete menu item
-        $('#menu-container .item-delete').live( 'click', function(e){
-                return wp_remove_menu_item( $(this).attr('value') );
-        });
</del><ins>+                        hidden += '<input type="hidden" name="menu-item-db-id[]" value="' + item_db_id + '" />';
+                        hidden += '<input type="hidden" name="menu-item-object-id[]" value="' + item_object_id + '" />';
+                        hidden += '<input type="hidden" name="menu-item-object[]" value="' + item_object + '" />';
+                        hidden += '<input type="hidden" name="menu-item-type[]" value="' + item_type + '" />';
+                        hidden += '<input type="hidden" name="menu-item-parent-id[]" value="' + item_parent_id + '" />';
+                        hidden += '<input type="hidden" name="menu-item-position[]" value="' + randomnumber + '" />';
+                        hidden += '<input type="hidden" name="menu-item-title[]" value="' + item_title + '" />';
+                        hidden += '<input type="hidden" name="menu-item-attr-title[]" value="' + item_attr_title + '" />';
+                        hidden += '<input type="hidden" name="menu-item-url[]" value="' + item_url + '" />';
+                        hidden += '<input type="hidden" name="menu-item-target[]" value="' + item_target + '" />';
+                        hidden += '<input type="hidden" name="menu-item-description[]" value="' + item_description + '" />';
+                        hidden += '<input type="hidden" name="menu-item-classes[]" value="' + item_classes + '" />';
+                        hidden += '<input type="hidden" name="menu-item-xfn[]" value="' + item_xfn + '" />';
</ins><span class="cx">
</span><del>-        // Update menu item settings (thickbox)
-        $('#update-menu-item').click(function(){
-                wp_update_menu_item();
-                return tb_remove();
-        });
-
-        // Close thickbox
-        $('#cancel-save').click(function(){
-                return tb_remove();
-        });
-
-        // Show All Button
-        $('.show-all').click(function(e){
-                jQuery(e.currentTarget).parent().siblings('.list-wrap').css( 'display', 'block' );
-                jQuery(e.currentTarget).parent().siblings('.list-wrap').find('li').css( 'display', 'block' );
-                jQuery(e.currentTarget).hide();
-                jQuery(e.currentTarget).siblings('.hide-all').show();
-        });
-
-        // Hide All Button
-        $('.hide-all').click(function(e){
-                jQuery(e.currentTarget).parent().siblings('.list-wrap').css( 'display', 'none' );
-                jQuery(e.currentTarget).parent().siblings('.list-wrap').find('li').css( 'display', 'none' );
-                jQuery(e.currentTarget).hide();
-                jQuery(e.currentTarget).siblings('.show-all').show();
-        });
-
-        // Add menu items into the menu
-        $('.add-to-menu').click(function(e){
-                return wp_add_checked_items_to_menu(e.currentTarget);
-        });
-
-        // Create a new link then add it to the menu
-        $('#add-custom-links .add-to-menu a').click(function(e){
-                // Add link to menu
-                if ( $('#custom-menu-item-url').val() == $('#custom-menu-item-url').attr('defaultValue') )
-                        return; // Do not allow "http://" submissions to go through
-                wp_add_item_to_menu( 0, '', 'custom', navMenuL10n.custom, 0, $('#custom-menu-item-name').val(), $('#custom-menu-item-url').val(), '', '', '_self', '', '' );
-                $('#custom-menu-item-name').val($('#custom-menu-item-name').attr('defaultValue'));
-                $('#custom-menu-item-url' ).val($('#custom-menu-item-url' ).attr('defaultValue')).focus();
-        });
-});
</del><span class="cx">\ No newline at end of file
</span><ins>+                        return hidden;
+                }
+        }
+        
+        $(document).ready(function($){ wpNavMenu.init(); });
+})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminjsnavmenujs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.js (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.js        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/js/nav-menu.js        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -1 +1 @@
</span><del>-function wp_nav_menu_autocomplete(a){jQuery("#add-"+a+" .quick-search").autocomplete(jQuery("#add-"+a+" .autocomplete").val().split("|"));jQuery("#add-"+a+" .quick-search").result(function(b,d,c){jQuery("#add-"+a+" .list-wrap").css("display","block");jQuery("#add-"+a+" .list-wrap li:contains('"+d+"')").css("display","block");jQuery("#add-"+a+" .show-all").hide();jQuery("#add-"+a+" .hide-all").show()})}function wp_edit_menu_item(a){var f=jQuery("#menu-item-type"+a).val();var b=jQuery("#menu-item-title"+a).val();var g=jQuery("#menu-item-url"+a).val();var c=jQuery("#menu-item-attr-title"+a).val();var d=jQuery("#menu-item-target"+a).val();var h=jQuery("#menu-item-description"+a).val();var e=jQuery("#menu-item-classes"+a).val();var i=jQuery("#menu-item-xfn"+a).val();if("custom"!=f){jQuery("#edit-menu-item-url").attr("disabled","disabled")}jQuery("#edit-menu-item-id").val(a);jQuery("#edit-menu-item-title").val(b);jQuery("#edit-menu-item-url").val(g);jQuery("#edit-menu-item-attr-title").val(c);jQuery("#edit-menu-item-target").val(d);jQuery("#edit-menu-item-target option[value='"+d+"']").attr("selected","selected");jQuery("#edit-menu-item-description").val(h);jQuery("#edit-menu-item-classes").val(e);jQuery("#edit-menu-item-xfn").val(i);jQuery("#edit-menu-item-title").focus()}function wp_update_menu_item(){var h=jQuery("#edit-menu-item-id").val();var f=jQuery("#edit-menu-item-title").val();var b=jQuery("#edit-menu-item-url").val();var g=jQuery("#edit-menu-item-attr-title").val();var d=jQuery("#edit-menu-item-target").val();var c=jQuery("#edit-menu-item-description").val();var a=jQuery("#edit-menu-item-classes").val();var e=jQuery("#edit-menu-item-xfn").val();jQuery(".menu #menu-item"+h).find("span.item-title").html(f);jQuery(".menu #menu-item-title"+h).val(f);jQuery(".menu #menu-item-url"+h).val(b);jQuery(".menu #menu-item-attr-title"+h).val(g);jQuery(".menu #menu-item-target"+h).val(d);jQuery(".menu #menu-item-description"+h).val(c);jQuery(".menu #menu-item-classes"+h).val(a);jQuery(".menu #menu-item-xfn"+h).val(e);jQuery(".menu #menu-item"+h+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){jQuery(this).css("backgroundColor","")}})}function wp_remove_menu_item(b){var a=document.getElementById("menu-item"+b);if(a){jQuery(a).find("dt").each(function(){jQuery(this).animate({backgroundColor:"#FF3333"},{duration:"normal",complete:function(){jQuery(this).parent().parent().remove()}})})}}function wp_add_item_to_menu(a,k,f,n,l,b,m,h,e,d,c,i){var j=wp_get_unique_menu_id();var g=wp_get_hidden_inputs(j,a,k,f,n,l,b,m,h,e,d,c,i);jQuery(".menu").append('<li id="menu-item'+j+'" value="'+j+'"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">'+b+'</span><span class="item-controls"><span class="item-type">'+n+'</span><a class="item-edit thickbox" id="edit'+j+'" value="'+j+'" onClick="wp_edit_menu_item('+j+')" title="'+navMenuL10n.thickbox+'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'+navMenuL10n.edit+'</a> | <a class="item-delete" id="delete'+j+'" value="'+j+'">Delete</a></span></dt></dl>'+g+"</li>");jQuery(".menu #menu-item"+j+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){jQuery(this).css("backgroundColor","")}});wp_drag_and_drop();tb_init("a.thickbox, area.thickbox, input.thickbox")}function wp_add_checked_items_to_menu(b){var a=jQuery(b).siblings(".list-wrap").find(":checked");if(0==a.length){return false}jQuery(a).each(function(){var h=jQuery(this).parent().siblings(".menu-item-type").val();if("custom"==h){var e=jQuery(this).parent().siblings(".menu-item-attr-title").val();var f=jQuery(this).parent().siblings(".menu-item-target").val();var g=jQuery(this).parent().siblings(".menu-item-classes").val();var j=jQuery(this).parent().siblings(".menu-item-xfn").val()}else{var e="";var f="_self";var g="";var j=""}var c=jQuery(this).parent().siblings(".menu-item-db-id").val();var k=jQuery(this).parent().siblings(".menu-item-object-id").val();var n=jQuery(this).parent().siblings(".menu-item-append").val();var l=jQuery(this).parent().siblings(".menu-item-parent-id").val();var d=jQuery(this).parent().siblings(".menu-item-title").val();var m=jQuery(this).parent().siblings(".menu-item-url").val();var i=jQuery(this).parent().siblings(".menu-item-description").val();if(undefined==i){i=""}wp_add_item_to_menu(c,k,h,n,l,d,m,i,e,f,g,j);jQuery(this).attr("checked",false)})}function wp_drag_and_drop(){jQuery(".menu li").each(function(){if(!jQuery(this).children(".dropzone").attr("class")){jQuery(this).prepend('<div class="dropzone"></div>')}});jQuery(".menu li").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});jQuery(".menu li dl, .menu li .dropzone").droppable({accept:".menu li",tolerance:"pointer",drop:function(f,d){var a=jQuery(this).parent();var g=!jQuery(this).hasClass("dropzone");if(g&&a.children("ul").length==0){a.append('<ul class="sub-menu" />')}if(g){a.children("ul").append(d.draggable)}else{a.before(d.draggable)}a.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var c=d.draggable.attr("value");var b=a.attr("value");a.find("#menu-"+c).find("#parent"+c).val(b);jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style")},over:function(){if(jQuery(this).attr("class")=="dropzone ui-droppable"){jQuery(this).parent().find("div:first").css("background","none").css("height","50px")}else{if(jQuery(this).attr("class")=="ui-droppable"){jQuery(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}var a=jQuery(this).parent().attr("id")},out:function(){jQuery(this).parent().find("dt").removeAttr("style");jQuery(this).parent().find("div:first").removeAttr("style");jQuery(this).filter(".dropzone").css({borderColor:""})}})}function wp_update_post_data(){var a=0;jQuery(".menu li").each(function(c){c=c+1;var b=jQuery(this).attr("value");jQuery(this).find("#menu-item-position"+b).attr("value",c);jQuery(this).attr("id","menu-item"+c);jQuery(this).attr("value",c);jQuery(this).find("#menu-item-db-id"+b).attr("id","menu-item-db-id"+c);jQuery(this).find("#menu-item-object-id"+b).attr("id","menu-item-object-id"+c);jQuery(this).find("#menu-item-append"+b).attr("id","menu-item-append"+c);jQuery(this).find("#menu-item-type"+b).attr("id","menu-item-type"+c);jQuery(this).find("#menu-item-position"+b).attr("id","menu-item-position"+c);var d=jQuery(this).find("#menu-item-parent-id"+b).parent().parent().parent().attr("value");jQuery(this).find("#menu-item-parent-id"+b).attr("id","menu-item-parent-id"+c);if(d){}else{d=0}jQuery(this).find("#menu-item-parent-id"+b).attr("value",d);jQuery(this).find("#menu-item-title"+b).attr("id","menu-item-title"+c);jQuery(this).find("#menu-item-url"+b).attr("id","menu-item-url"+c);jQuery(this).find("#menu-item-description"+b).attr("id","menu-item-description"+c);jQuery(this).find("#menu-item-classes"+b).attr("id","menu-item-classes"+c);jQuery(this).find("#menu-item-xfn"+b).attr("id","menu-item-xfn"+c);jQuery(this).find("#menu-item-description"+b).attr("id","menu-item-description"+c);jQuery(this).find("#menu-item-attr-title"+b).attr("id","menu-item-attr-title"+c);jQuery(this).find("#menu-item-target"+b).attr("id","menu-item-target"+c);jQuery("#li-count").attr("value",c)})}function wp_get_unique_menu_id(){var d=jQuery(".menu li").length+1;var e=d;var a=0;try{var f=document.getElementById("menu-"+e.toString()).value}catch(c){a=1}while(a==0){e=e+1;try{var b=document.getElementById("menu-"+e.toString()).value}catch(c){a=1}}return e}function wp_get_hidden_inputs(j,a,k,f,n,l,b,m,h,e,d,c,i){var g="";g+='<input type="hidden" name="menu-item-db-id[]" id="menu-item-db-id'+j+'" value="'+a+'" />';g+='<input type="hidden" name="menu-item-object-id[]" id="menu-item-object-id'+j+'" value="'+k+'" />';g+='<input type="hidden" name="menu-item-type[]" id="menu-item-type'+j+'" value="'+f+'" />';g+='<input type="hidden" name="menu-item-append[]" id="menu-item-append'+j+'" value="'+n+'" />';g+='<input type="hidden" name="menu-item-parent-id[]" id="menu-item-parent-id'+j+'" value="'+l+'" />';g+='<input type="hidden" name="menu-item-position[]" id="menu-item-position'+j+'" value="'+j+'" />';g+='<input type="hidden" name="menu-item-title[]" id="menu-item-title'+j+'" value="'+b+'" />';g+='<input type="hidden" name="menu-item-attr-title[]" id="menu-item-attr-title'+j+'" value="'+e+'" />';g+='<input type="hidden" name="menu-item-url[]" id="menu-item-url'+j+'" value="'+m+'" />';g+='<input type="hidden" name="menu-item-target[]" id="menu-item-target'+j+'" value="'+d+'" />';g+='<input type="hidden" name="menu-item-description[]" id="menu-item-description'+j+'" value="'+h+'" />';g+='<input type="hidden" name="menu-item-classes[]" id="menu-item-classes'+j+'" value="'+c+'" />';g+='<input type="hidden" name="menu-item-xfn[]" id="menu-item-xfn'+j+'" value="'+i+'" />';return g}jQuery(document).ready(function(a){wp_drag_and_drop();a("#update-nav-menu .deletion").click(function(){if(confirm(navMenuL10n.warnDelete)){return true}else{return false}});a("#save_menu").click(function(){return wp_update_post_data()});a("#create-menu-name").keypress(function(b){if(13==b.keyCode){a("#create-menu-button").click();return false}});a("#custom-menu-item-url, #custom-menu-item-name").keypress(function(b){if(13==b.keyCode){a("#add-custom-links a.button").click();return false}}).focus(function(){if(a(this).val()==a(this).attr("defaultValue")&&a(this).attr("id")!="custom-menu-item-url"){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a("#create-menu-name").focus(function(){if(a(this).val()==a(this).attr("defaultValue")){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("menus");a(".quick-search").click(function(){a(this).attr("value","")});a(".quick-search-submit").click(function(){a(this).siblings(".quick-search").search()});a("#menu-container .item-edit").click(function(){return wp_edit_menu_item(a(this).attr("value"))});a("#menu-container .item-delete").live("click",function(b){return wp_remove_menu_item(a(this).attr("value"))});a("#update-menu-item").click(function(){wp_update_menu_item();return tb_remove()});a("#cancel-save").click(function(){return tb_remove()});a(".show-all").click(function(b){jQuery(b.currentTarget).parent().siblings(".list-wrap").css("display","block");jQuery(b.currentTarget).parent().siblings(".list-wrap").find("li").css("display","block");jQuery(b.currentTarget).hide();jQuery(b.currentTarget).siblings(".hide-all").show()});a(".hide-all").click(function(b){jQuery(b.currentTarget).parent().siblings(".list-wrap").css("display","none");jQuery(b.currentTarget).parent().siblings(".list-wrap").find("li").css("display","none");jQuery(b.currentTarget).hide();jQuery(b.currentTarget).siblings(".show-all").show()});a(".add-to-menu").click(function(b){return wp_add_checked_items_to_menu(b.currentTarget)});a("#add-custom-links .add-to-menu a").click(function(b){if(a("#custom-menu-item-url").val()==a("#custom-menu-item-url").attr("defaultValue")){return}wp_add_item_to_menu(0,"","custom",navMenuL10n.custom,0,a("#custom-menu-item-name").val(),a("#custom-menu-item-url").val(),"","","_self","","");a("#custom-menu-item-name").val(a("#custom-menu-item-name").attr("defaultValue"));a("#custom-menu-item-url").val(a("#custom-menu-item-url").attr("defaultValue")).focus()})});
</del><span class="cx">\ No newline at end of file
</span><ins>+var wpNavMenu;(function(a){wpNavMenu={init:function(){wpNavMenu.initial_meta_boxes();wpNavMenu.drag_and_drop();a("#update-nav-menu .deletion").click(function(){if(confirm(navMenuL10n.warnDelete)){return true}else{return false}});a("#update-nav-menu").submit(function(){wpNavMenu.update_post_data()});a("#create-menu-name").keypress(function(b){if(13==b.keyCode){a("#create-menu-button").click();return false}});a("#custom-menu-item-url, #custom-menu-item-name").keypress(function(b){if(13==b.keyCode){a("#add-custom-links a.button").click();return false}}).focus(function(){if(a(this).val()==a(this).attr("defaultValue")&&a(this).attr("id")!="custom-menu-item-url"){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a("#create-menu-name").focus(function(){if(a(this).val()==a(this).attr("defaultValue")){a(this).val("")}}).blur(function(){if(a(this).val()==""){a(this).val(a(this).attr("defaultValue"))}});a(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("nav-menus");a(".quick-search").click(function(){a(this).attr("value","")});a(".quick-search-submit").click(function(){a(this).siblings(".quick-search").search()});a("#menu-container .item-edit").click(function(){wpNavMenu.edit_menu_item(a(this).attr("value"))});a("#menu-container .item-delete").click(function(){wpNavMenu.remove_menu_item(a(this).attr("value"))});a("#update-menu-item").click(function(){wpNavMenu.update_menu_item();tb_remove()});a("#cancel-save").click(function(){tb_remove()});a(".show-all").click(function(b){a(b.currentTarget).parent().parent().siblings(".list-wrap").css("display","block");a(b.currentTarget).parent().parent().siblings(".list-wrap").find("li").css("display","block");a(b.currentTarget).hide();a(b.currentTarget).siblings(".hide-all").show()});a(".hide-all").click(function(b){a(b.currentTarget).parent().parent().siblings(".list-wrap").css("display","none");a(b.currentTarget).parent().parent().siblings(".list-wrap").find("li").css("display","none");a(b.currentTarget).hide();a(b.currentTarget).siblings(".show-all").show()});a(".add-to-menu").click(function(b){wpNavMenu.add_checked_items_to_menu(b.currentTarget)});a("#add-custom-links .add-to-menu a").click(function(b){if(a("#custom-menu-item-url").val()==a("#custom-menu-item-url").attr("defaultValue")){return}wpNavMenu.add_custom_link(a("#custom-menu-item-name").val(),a("#custom-menu-item-url").val());a("#custom-menu-item-name").val(a("#custom-menu-item-name").attr("defaultValue"));a("#custom-menu-item-url").val(a("#custom-menu-item-url").attr("defaultValue")).focus()})},add_custom_link:function(c,b){var d={action:"save-custom-link",link_name:c,link_url:b};a.post(ajaxurl,d,function(e){if("-1"==e){return}wpNavMenu.add_to_menu(e,e,"custom","custom",navMenuL10n.custom,0,c,b,"","","_self","","")},"json")},initial_meta_boxes:function(){var c=a("#hidden-metaboxes").val().split(",");if(""!=c){for(var b=0;b<c.length;b++){a("#"+c[b]).attr("style","display: none;");a("#"+c[b]+"-hide").attr("checked",false)}}},drag_and_drop:function(){a(".menu li").each(function(){if(!a(this).children(".dropzone").attr("class")){a(this).prepend('<div class="dropzone"></div>')}});a(".menu li").draggable({handle:" > dl",opacity:0.8,addClasses:false,helper:"clone",zIndex:100});a(".menu li dl, .menu li .dropzone").droppable({accept:".menu li",tolerance:"pointer",drop:function(g,f){var b=a(this).parent();var h=!a(this).hasClass("dropzone");if(h&&b.children("ul").length==0){b.append('<ul class="sub-menu" />')}if(h){b.children("ul").append(f.draggable)}else{b.before(f.draggable)}b.find("dl,.dropzone").css({backgroundColor:"",borderColor:""});var d=f.draggable.attr("value");var c=b.attr("value");b.find("#menu-"+d).find("#parent"+d).val(c);a(this).parent().find("dt").removeAttr("style");a(this).parent().find("div:first").removeAttr("style")},over:function(b){if(a(this).attr("class")=="dropzone ui-droppable"){a(this).parent().find("div:first").css({background:"#f5f5f5",border:"1px dashed #bbb",margin:"10px 0px",height:"40px"})}else{if(a(this).attr("class")=="ui-droppable"){a(this).parent().find("dt:first").css("background","#d8d8d8")}else{}}},out:function(){a(this).parent().find("dt").removeAttr("style");a(this).parent().find("div:first").removeAttr("style");a(this).filter(".dropzone").css({borderColor:""})}})},update_post_data:function(){var b=0;a(".menu li").each(function(){b=b+1;var d=a(this).attr("value");var e=a(this).children("input[name=menu-item-db-id[]]").val();a(this).attr("value",b);a(this).children("input[name=menu-item-position[]]").attr("value",b);var c=a(this).parent(".sub-menu").siblings("input[name=menu-item-object-id[]]").val();if(undefined==c){c=0}a(this).children("input[name=menu-item-parent-id[]]").attr("value",c);a("#li-count").attr("value",b)})},autocomplete:function(b){a("#add-"+b+" .quick-search").autocomplete(a("#add-"+b+" .autocomplete").val().split("|"));a("#add-"+b+" .quick-search").result(function(c,e,d){a("#add-"+b+" .list-wrap").css("display","block");a("#add-"+b+" .list-wrap li:contains('"+e+"')").css("display","block");a("#add-"+b+" .show-all").hide();a("#add-"+b+" .hide-all").show()})},edit_menu_item:function(b){var g=a("#menu-item-"+b).children("input[name=menu-item-type[]]").val();var c=a("#menu-item-"+b).children("input[name=menu-item-title[]]").val();var h=a("#menu-item-"+b).children("input[name=menu-item-url[]]").val();var d=a("#menu-item-"+b).children("input[name=menu-item-attr-title[]]").val();var e=a("#menu-item-"+b).children("input[name=menu-item-target[]]").val();var i=a("#menu-item-"+b).children("input[name=menu-item-description[]]").val();var f=a("#menu-item-"+b).children("input[name=menu-item-classes[]]").val();var j=a("#menu-item-"+b).children("input[name=menu-item-xfn[]]").val();if("custom"!=g){a("#edit-menu-item-url").attr("disabled","disabled")}a("#edit-menu-item-id").val(b);a("#edit-menu-item-title").val(c);a("#edit-menu-item-url").val(h);a("#edit-menu-item-attr-title").val(d);a("#edit-menu-item-target").val(e);a("#edit-menu-item-target option[value='"+e+"']").attr("selected","selected");a("#edit-menu-item-description").val(i);a("#edit-menu-item-classes").val(f);a("#edit-menu-item-xfn").val(j)},update_menu_item:function(){var i=a("#edit-menu-item-id").val();var g=a("#edit-menu-item-title").val();var c=a("#edit-menu-item-url").val();var h=a("#edit-menu-item-attr-title").val();var e=a("#edit-menu-item-target").val();var d=a("#edit-menu-item-description").val();var b=a("#edit-menu-item-classes").val();var f=a("#edit-menu-item-xfn").val();a(".menu #menu-item-"+i).find("span.item-title:first").html(g);a("#menu-item-"+i).children("input[name=menu-item-title[]]").val(g);a("#menu-item-"+i).children("input[name=menu-item-url[]]").val(c);a("#menu-item-"+i).children("input[name=menu-item-attr-title[]]").val(h);a("#menu-item-"+i).children("input[name=menu-item-target[]]").val(e);a("#menu-item-"+i).children("input[name=menu-item-description[]]").val(d);a("#menu-item-"+i).children("input[name=menu-item-classes[]]").val(b);a("#menu-item-"+i).children("input[name=menu-item-xfn[]]").val(f);a(".menu #menu-item-"+i+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}})},remove_menu_item:function(c){var b=a("#menu-item-"+c);if(b){a(b).find("dt").each(function(){a(this).animate({backgroundColor:"#FF3333"},{duration:"normal",complete:function(){a(this).parent().parent().remove()}})})}},add_to_menu:function(b,m,c,h,p,n,d,o,j,g,f,e,k){var l=a(".menu li").length+1;var i=wpNavMenu.get_hidden_inputs(l,b,m,c,h,n,d,o,j,g,f,e,k);a(".menu").append('<li id="menu-item-'+l+'" value="'+l+'"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">'+d+'</span><span class="item-controls"><span class="item-type">'+p+'</span><a class="item-edit thickbox" id="edit'+l+'" value="'+l+'" onclick="wpNavMenu.edit_menu_item('+l+');" title="'+navMenuL10n.thickbox+'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'+navMenuL10n.edit+'</a> | <a class="item-delete" id="delete'+l+'" value="'+l+'" onclick="wpNavMenu.remove_menu_item('+l+');">Delete</a></span></dt></dl>'+i+"</li>");a(".menu #menu-item-"+l+" dt:first").animate({backgroundColor:"#FFFF33"},{duration:"normal",complete:function(){a(this).css("backgroundColor","")}});wpNavMenu.drag_and_drop();tb_init("a.thickbox, area.thickbox, input.thickbox")},add_checked_items_to_menu:function(c){var b=a(c).parent().siblings(".list-wrap").find(":checked");if(0==b.length){return false}a(b).each(function(){var j=a(this).parent().siblings(".menu-item-type").val();if("custom"==j){var g=a(this).parent().siblings(".menu-item-attr-title").val();var h=a(this).parent().siblings(".menu-item-target").val();var i=a(this).parent().siblings(".menu-item-classes").val();var l=a(this).parent().siblings(".menu-item-xfn").val()}else{var g="";var h="_self";var i="";var l=""}var d=a(this).parent().siblings(".menu-item-db-id").val();var m=a(this).parent().siblings(".menu-item-object-id").val();var e=a(this).parent().siblings(".menu-item-object").val();var p=a(this).parent().siblings(".menu-item-append").val();var n=a(this).parent().siblings(".menu-item-parent-id").val();var f=a(this).parent().siblings(".menu-item-title").val();var o=a(this).parent().siblings(".menu-item-url").val();var k=a(this).parent().siblings(".menu-item-description").val();if(undefined==k){k=""}if(undefined==g){g=""}wpNavMenu.add_to_menu(d,m,e,j,p,n,f,o,k,g,h,i,l);a(this).attr("checked",false)})},get_hidden_inputs:function(l,b,m,c,h,n,d,o,j,g,f,e,k){var i="";i+='<input type="hidden" name="menu-item-db-id[]" value="'+b+'" />';i+='<input type="hidden" name="menu-item-object-id[]" value="'+m+'" />';i+='<input type="hidden" name="menu-item-object[]" value="'+c+'" />';i+='<input type="hidden" name="menu-item-type[]" value="'+h+'" />';i+='<input type="hidden" name="menu-item-parent-id[]" value="'+n+'" />';i+='<input type="hidden" name="menu-item-position[]" value="'+l+'" />';i+='<input type="hidden" name="menu-item-title[]" value="'+d+'" />';i+='<input type="hidden" name="menu-item-attr-title[]" value="'+g+'" />';i+='<input type="hidden" name="menu-item-url[]" value="'+o+'" />';i+='<input type="hidden" name="menu-item-target[]" value="'+f+'" />';i+='<input type="hidden" name="menu-item-description[]" value="'+j+'" />';i+='<input type="hidden" name="menu-item-classes[]" value="'+e+'" />';i+='<input type="hidden" name="menu-item-xfn[]" value="'+k+'" />';return i}};a(document).ready(function(b){wpNavMenu.init()})})(jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-admin/nav-menus.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -12,6 +12,9 @@
</span><span class="cx"> /** Load WordPress Administration Bootstrap */
</span><span class="cx"> require_once( 'admin.php' );
</span><span class="cx">
</span><ins>+// Load all the nav menu interface functions
+require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
+
</ins><span class="cx"> // Permissions Check
</span><span class="cx"> if ( ! current_user_can('switch_themes') )
</span><span class="cx">         wp_die( __( 'Cheatin&#8217; uh?' ));
</span><span class="lines">@@ -37,9 +40,6 @@
</span><span class="cx"> // Thickbox
</span><span class="cx"> add_thickbox();
</span><span class="cx">
</span><del>-// Load all the nav menu interface functions
-require_once( ABSPATH . 'wp-admin/includes/nav-menu.php' );
-
</del><span class="cx"> // Container for any messages displayed to the user
</span><span class="cx"> $messages_div = '';
</span><span class="cx">
</span><span class="lines">@@ -57,9 +57,15 @@
</span><span class="cx">                 check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id );
</span><span class="cx">
</span><span class="cx">                 if ( is_nav_menu($nav_menu_selected_id) ) {
</span><del>-                        wp_delete_nav_menu( $nav_menu_selected_id );
-                        $messages_div = '<div id="message" class="updated fade below-h2"><p>' . __('Menu successfully deleted.') . '</p></div>';
-                        $nav_menu_selected_id = 0;
</del><ins>+                        $delete_nav_menu = wp_delete_nav_menu( $nav_menu_selected_id );
+                        
+                        if ( is_wp_error($delete_nav_menu) ) {
+                                $messages_div = '<div id="message" class="error"><p>' . $delete_nav_menu->get_error_message() . '</p></div>';
+                        } else {
+                                $messages_div = '<div id="message" class="updated"><p>' . __('The menu has been successfully deleted.') . '</p></div>';
+                                $nav_menu_selected_id = 0; // Reset the selected menu
+                        }
+                        unset( $delete_nav_menu );
</ins><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="cx">
</span><span class="lines">@@ -75,36 +81,45 @@
</span><span class="cx">                                         $add_nav_menu = wp_create_nav_menu( $add_nav_menu );
</span><span class="cx">
</span><span class="cx">                                         if ( is_wp_error( $add_nav_menu ) ) {
</span><del>-                                                $messages_div = '<div id="message" class="error fade below-h2"><p>' . $add_nav_menu->get_error_message() . '</p></div>';
</del><ins>+                                                $messages_div = '<div id="message" class="error"><p>' . $add_nav_menu->get_error_message() . '</p></div>';
</ins><span class="cx">                                         } else {
</span><span class="cx">                                                 $nav_menu_selected_id = $add_nav_menu->term_id;
</span><span class="cx">                                                 $nav_menu_selected_title = $add_nav_menu->name;
</span><del>-                                                $messages_div = '<div id="message" class="updated fade below-h2"><p>' . sprintf( __('The <strong>%s</strong> menu has been successfully created.'), esc_html( $add_nav_menu->name ) ) . '</p></div>';
</del><ins>+                                                $messages_div = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been successfully created.'), $add_nav_menu->name ) . '</p></div>';
</ins><span class="cx">                                         }
</span><span class="cx">                                 } else {
</span><del>-                                        $messages_div = '<div id="message" class="error fade below-h2"><p>' . __('Please enter a valid menu name.') . '</p></div>';
</del><ins>+                                        $messages_div = '<div id="message" class="error"><p>' . __('Please enter a valid menu name.') . '</p></div>';
</ins><span class="cx">                                 }
</span><del>-                                unset($add_nav_menu);
</del><ins>+                                unset( $add_nav_menu );
</ins><span class="cx">                         }
</span><span class="cx">                 } else {
</span><ins>+                        
+                        // @todo wrap this into wp_update_nav_menu_object();
</ins><span class="cx">                         if ( isset($_POST['menu-name']) ) {
</span><span class="cx">                                 $old_nav_menu = get_term( $nav_menu_selected_id, 'nav_menu', ARRAY_A );
</span><span class="cx">                                 $args = array( 'name' => $_POST['menu-name'], 'slug' => null, 'description' => $old_nav_menu['description'], 'parent' => $old_nav_menu['parent'], );
</span><span class="cx">                                 $new_nav_menu = wp_update_term( $nav_menu_selected_id, 'nav_menu', $args );
</span><span class="cx">                         }
</span><del>-
</del><ins>+                        
</ins><span class="cx">                         // Update menu items
</span><del>-                        $update_nav_items = isset( $_POST['li-count'] ) ? (int) $_POST['li-count'] : 0;
</del><ins>+                        
+                        // @todo: wrap update logic into wp_update_nav_menu();
+                        $update_count = isset( $_POST['li-count'] ) ? (int) $_POST['li-count'] : 0;
</ins><span class="cx">                         $update_nav_menu = is_nav_menu( $nav_menu_selected_id );
</span><span class="cx">
</span><span class="cx">                         if ( !is_wp_error($update_nav_menu) ) {
</span><span class="cx">                                 $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') );
</span><del>-                                $parent_menu_ids = array();
-
</del><ins>+                                
</ins><span class="cx">                                 // Loop through all POST variables
</span><del>-                                for ( $k = 0; $k < $update_nav_items; $k++ ) {
</del><ins>+                                for ( $k = 0; $k < $update_count; $k++ ) {
+                                        
+                                        // Menu item title can't be blank
+                                        if ( '' == $_POST['menu-item-title'][$k] )
+                                                continue;
+                                        
</ins><span class="cx">                                         $menu_item_db_id = isset( $_POST['menu-item-db-id'][$k] ) ? $_POST['menu-item-db-id'][$k] : 0;
</span><span class="cx">                                         $menu_item_object_id = isset( $_POST['menu-item-object-id'][$k] ) ? $_POST['menu-item-object-id'][$k] : 0;
</span><ins>+                                        $menu_item_object = isset( $_POST['menu-item-object'][$k] ) ? $_POST['menu-item-object'][$k] : '';
</ins><span class="cx">                                         $menu_item_parent_id = isset( $_POST['menu-item-parent-id'][$k] ) ? $_POST['menu-item-parent-id'][$k] : 0;
</span><span class="cx">                                         $menu_item_position = isset( $_POST['menu-item-position'][$k] ) ? $_POST['menu-item-position'][$k] : 0;
</span><span class="cx">                                         $menu_item_type = isset( $_POST['menu-item-type'][$k] ) ? $_POST['menu-item-type'][$k] : 'custom';
</span><span class="lines">@@ -113,41 +128,40 @@
</span><span class="cx">                                         $menu_item_url = isset( $_POST['menu-item-url'][$k] ) ? $_POST['menu-item-url'][$k] : '';
</span><span class="cx">                                         $menu_item_description = isset( $_POST['menu-item-description'][$k] ) ? $_POST['menu-item-description'][$k] : '';
</span><span class="cx">                                         $menu_item_attr_title = isset( $_POST['menu-item-attr-title'][$k] ) ? $_POST['menu-item-attr-title'][$k] : '';
</span><del>-                                        $menu_item_target = isset( $_POST['menu-item-target'][$k] ) ? $_POST['menu-item-target'][$k] : 0;
</del><ins>+                                        $menu_item_target = isset( $_POST['menu-item-target'][$k] ) ? $_POST['menu-item-target'][$k] : '_self';
</ins><span class="cx">                                         $menu_item_classes = isset( $_POST['menu-item-classes'][$k] ) ? $_POST['menu-item-classes'][$k] : '';
</span><span class="cx">                                         $menu_item_xfn = isset( $_POST['menu-item-xfn'][$k] ) ? $_POST['menu-item-xfn'][$k] : '';
</span><span class="cx">
</span><del>-                                        // Menu item title can't be blank
-                                        if ( '' == $menu_item_title )
-                                                continue;
-
-                                        // Populate the menu item
-                                        $post = array( 'post_status' => 'publish', 'post_type' => 'nav_menu_item', 'post_author' => $user_ID,
-                                                'ping_status' => 0, 'post_parent' => $menu_item_parent_id, 'menu_order' => $menu_item_position,
-                                                'post_excerpt' => $menu_item_attr_title, 'tax_input' => array( 'nav_menu' => $update_nav_menu->name ),
-                                                'post_content' => $menu_item_description, 'post_title' => $menu_item_title );
-
</del><ins>+                                        // Populate the menu item object
+                                        $post = array(
+                                                'post_status' => 'publish', 'post_type' => 'nav_menu_item', 'ping_status' => 0,
+                                                'post_author' => $user_ID, 'tax_input' => array( 'nav_menu' => $update_nav_menu->name ),
+                                                'post_title' => $menu_item_title, 'post_excerpt' => $menu_item_attr_title,
+                                                'post_parent' => $menu_item_parent_id, 'menu_order' => $menu_item_position,
+                                                'post_content' => $menu_item_description,
+                                        );
+                                        
</ins><span class="cx">                                         // New menu item
</span><span class="cx">                                         if ( $menu_item_db_id == 0 ) {
</span><span class="cx">                                                 $menu_item_db_id = wp_insert_post( $post );
</span><del>-                                        } elseif ( isset( $menu_items[$menu_item_db_id] ) ) {
</del><ins>+                                        
+                                        // Update existing menu item
+                                        } elseif ( isset($menu_items[$menu_item_db_id]) || ( 'custom' == $menu_item_type && 0 != $menu_item_db_id ) ) {
</ins><span class="cx">                                                 $post['ID'] = $menu_item_db_id;
</span><span class="cx">                                                 wp_update_post( $post );
</span><span class="cx">                                                 unset( $menu_items[$menu_item_db_id] );
</span><span class="cx">                                         }
</span><del>-                                        $parent_menu_ids[$k] = $menu_item_db_id;
</del><span class="cx">
</span><del>-                                        // @todo sanitize type append and ID.
-                                        update_post_meta( $menu_item_db_id, 'menu_item_type', $menu_item_type );
-                                        update_post_meta( $menu_item_db_id, 'menu_item_append', $menu_item_append );
-                                        update_post_meta( $menu_item_db_id, 'menu_item_object_id', $menu_item_object_id );
-                                        update_post_meta( $menu_item_db_id, 'menu_item_target', sanitize_key($menu_item_target) );
</del><ins>+                                        update_post_meta( $menu_item_db_id, '_menu_item_type', sanitize_key($menu_item_type) );
+                                        update_post_meta( $menu_item_db_id, '_menu_item_object_id', (int) $menu_item_object_id );
+                                        update_post_meta( $menu_item_db_id, '_menu_item_object', sanitize_key($menu_item_object) );
+                                        update_post_meta( $menu_item_db_id, '_menu_item_target', sanitize_key($menu_item_target) );
</ins><span class="cx">                                         // @todo handle sanitizing multiple classes separated by whitespace.
</span><del>-                                        update_post_meta( $menu_item_db_id, 'menu_item_classes', sanitize_html_class($menu_item_classes) );
-                                        update_post_meta( $menu_item_db_id, 'menu_item_xfn', sanitize_html_class($menu_item_xfn) );
</del><ins>+                                        update_post_meta( $menu_item_db_id, '_menu_item_classes', sanitize_html_class($menu_item_classes) );
+                                        update_post_meta( $menu_item_db_id, '_menu_item_xfn', sanitize_html_class($menu_item_xfn) );
</ins><span class="cx">
</span><span class="cx">                                         // @todo: only save custom link urls.
</span><del>-                                        update_post_meta( $menu_item_db_id, 'menu_item_url', esc_url_raw( $menu_item_url ) );
</del><ins>+                                        update_post_meta( $menu_item_db_id, '_menu_item_url', esc_url_raw($menu_item_url) );
</ins><span class="cx">                                 }
</span><span class="cx">
</span><span class="cx">                                 // Remove menu items from the menu that weren't in $_POST
</span><span class="lines">@@ -156,7 +170,11 @@
</span><span class="cx">                                                 wp_delete_post( $menu_item_id );
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><del>-                                $messages_div = '<div id="message" class="updated fade below-h2"><p>' . __('The menu has been updated.') . '</p></div>';
</del><ins>+                                
+                                do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
+                                
+                                $messages_div = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been updated.'), $update_nav_menu->name ) . '</p></div>';
+                                unset( $update_nav_menu, $update_count, $menu_items );
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 break;
</span><span class="lines">@@ -190,15 +208,24 @@
</span><span class="cx">         $nav_menu_selected_title = $nav_menu_selected_title->name;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+// Create Menu Metabox
+add_meta_box( 'create-menu', __('Create Menu'), 'wp_nav_menu_create_metabox', 'nav-menus', 'side', 'core' );
+
</ins><span class="cx"> // The user has no menus.
</span><span class="cx"> if ( !is_nav_menu( $nav_menu_selected_id ) ) {
</span><del>-        if ( current_theme_supports('nav-menus') ) {
-                $messages_div = '<div id="message" class="updated"><p>' . __('You do not have any menus. Create a new menu.') . '</p></div>';
-        } else {
-                $messages_div = '<div id="message" class="error"><p>' . __('The current theme does not support menus.') . '</p></div>';
-        }
</del><ins>+        $messages_div = '<div id="message" class="updated"><p>' . __('You do not have any menus. Create a new menu.') . '</p></div>';
+        
+// The theme supports menus
+} elseif ( current_theme_supports('nav-menus') ) {
+        
+        // Register nav menu metaboxes
+        add_meta_box( 'manage-menu', __( 'Menu Settings' ), 'wp_nav_menu_manage_menu_metabox', 'nav-menus', 'side', 'high', array( $nav_menu_selected_id, $nav_menu_selected_title ) );
+        wp_nav_menu_metaboxes_setup();
+
+// The theme does not support menus
</ins><span class="cx"> } else {
</span><del>-        add_meta_box( 'manage-menu', __( 'Menu Settings' ), 'wp_nav_menu_manage_menu_metabox', 'menus', 'side', 'high', array( $nav_menu_selected_id, $nav_menu_selected_title ) );
</del><ins>+        remove_meta_box( 'create-menu', 'nav-menus', 'side' );
+        $messages_div = '<div id="message" class="error"><p>' . __('The current theme does not support menus.') . '</p></div>';
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Get the admin header
</span><span class="lines">@@ -210,7 +237,7 @@
</span><span class="cx">         <?php echo $messages_div; ?>
</span><span class="cx">         <div class="hide-if-js error"><p><?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.'); ?></p></div>
</span><span class="cx">
</span><del>-        <?php if ( !empty($nav_menus) && count($nav_menus) > 1 ) : ?>
</del><ins>+        <?php if ( !empty($nav_menus) && count($nav_menus) > 1 && current_theme_supports('nav-menus') ) : ?>
</ins><span class="cx">         <ul class="subsubsub">
</span><span class="cx">                 <?php
</span><span class="cx">                         foreach ( $nav_menus as $_nav_menu ) {
</span><span class="lines">@@ -226,35 +253,30 @@
</span><span class="cx">         <?php endif; ?>
</span><span class="cx">
</span><span class="cx">         <div id="menu-management" class="metabox-holder has-right-sidebar">
</span><del>-                <form id="update-nav-menu" onsubmit="wp_update_post_data();" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
</del><ins>+                <form id="update-nav-menu" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
</ins><span class="cx">                         <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
</span><span class="cx">                         <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
</span><span class="cx">                         <?php wp_nonce_field( 'update-nav_menu' ); ?>
</span><span class="cx">                         <input type="hidden" name="action" value="update" />
</span><del>-                        <input type="hidden" name="li-count" id="li-count" value="0" />
</del><ins>+                        <input type="hidden" name="li-count" id="li-count" value="-1" />
</ins><span class="cx">                         <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
</span><del>-
</del><ins>+                        <input type="hidden" id="hidden-metaboxes" value="<?php echo wp_initial_nav_menu_meta_boxes(); ?>" />
</ins><span class="cx">                         <div id="post-body">
</span><span class="cx">                                 <div id="post-body-content">
</span><del>-                                        <?php if ( is_nav_menu($nav_menu_selected_id) ) : ?>
</del><ins>+                                        <?php if ( is_nav_menu($nav_menu_selected_id) && current_theme_supports('nav-menus') ) : ?>
</ins><span class="cx">                                                 <div id="menu-container" class="postbox">
</span><span class="cx">                                                         <h3 class="hndle"><?php echo esc_html( $nav_menu_selected_title ); ?></h3>
</span><span class="cx">                                                         <div class="inside">
</span><del>-
</del><span class="cx">                                                                 <?php echo wp_get_nav_menu( array( 'context' => 'backend', 'menu' => $nav_menu_selected_id ) ); ?>
</span><del>-
</del><span class="cx">                                                         </div><!-- /.inside -->
</span><span class="cx">                                                 <!-- /#nav-menu-canvas .postbox-->
</span><span class="cx">                                                 </div>
</span><del>-                                                <script type="text/javascript">
-                                                        wp_update_post_data();
-                                                </script>
</del><span class="cx">                                         <?php endif; ?>
</span><span class="cx">                                 </div><!-- /#post-body-content-->
</span><span class="cx">                         </div><!--- /#post-body -->
</span><span class="cx">                         <div id="menu-settings-column" class="inner-sidebar">
</span><span class="cx">
</span><del>-                                <?php do_meta_boxes( 'menus', 'side', null ); ?>
</del><ins>+                                <?php do_meta_boxes( 'nav-menus', 'side', null ); ?>
</ins><span class="cx">
</span><span class="cx">                         </div><!-- /#menu-settings-column -->
</span><span class="cx">                 </form><!--/#update-nav-menu-->
</span></span></pre></div>
<a id="trunkwpincludesclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/classes.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/classes.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-includes/classes.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -934,7 +934,7 @@
</span><span class="cx">                         else
</span><span class="cx">                                 $children_elements[ $e->$parent_field ][] = $e;
</span><span class="cx">                 }
</span><del>-
</del><ins>+                
</ins><span class="cx">                 /*
</span><span class="cx">                  * when none of the elements is top level
</span><span class="cx">                  * assume the first one must be root of the sub elements
</span><span class="lines">@@ -1124,6 +1124,102 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Create HTML list of nav menu items.
+ *
+ * @package WordPress
+ * @since 3.0.0
+ * @uses Walker
+ */
+class Walker_Nav_Menu extends Walker {
+        /**
+         * @see Walker::$tree_type
+         * @since 3.0.0
+         * @var string
+         */
+        var $tree_type = array( 'post_type', 'taxonomy', 'custom' );
+
+        /**
+         * @see Walker::$db_fields
+         * @since 3.0.0
+         * @todo Decouple this.
+         * @var array
+         */
+        var $db_fields = array( 'parent' => 'post_parent', 'id' => 'object_id' );
+
+        /**
+         * @see Walker::start_lvl()
+         * @since 3.0.0
+         *
+         * @param string $output Passed by reference. Used to append additional content.
+         * @param int $depth Depth of page. Used for padding.
+         */
+        function start_lvl(&$output, $depth) {
+                $indent = str_repeat("\t", $depth);
+                $output .= "\n$indent<ul class=\"sub-menu\">\n";
+        }
+
+        /**
+         * @see Walker::end_lvl()
+         * @since 3.0.0
+         *
+         * @param string $output Passed by reference. Used to append additional content.
+         * @param int $depth Depth of page. Used for padding.
+         */
+        function end_lvl(&$output, $depth) {
+                $indent = str_repeat("\t", $depth);
+                $output .= "$indent</ul>\n";
+        }
+
+        /**
+         * @see Walker::start_el()
+         * @since 3.0.0
+         *
+         * @param string $output Passed by reference. Used to append additional content.
+         * @param object $item Menu item data object.
+         * @param int $depth Depth of menu item. Used for padding.
+         * @param int $current_page Menu item ID.
+         * @param array $args
+         */
+        function start_el(&$output, $item, $depth, $args) {
+                $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
+                
+                if ( 'frontend' == $args->context ) {
+                        global $wp_query;
+                        
+                        $css_class = array( 'menu-item', 'menu-item-type-'. $item->type, $item->classes );
+                        
+                        if ( 'custom' != $item->object )
+                                $css_class[] = 'menu-item-object-'. $item->object;
+                        
+                        if ( $item->object_id == $wp_query->get_queried_object_id() )
+                                $css_class[] = 'current-menu-item';
+                        
+                        // @todo add classes for parent/child relationships
+
+                        $css_class = join( ' ', apply_filters('nav_menu_css_class', $css_class, $item) );
+                }
+                        
+                $maybe_value = ( 'backend' == $args->context ) ? ' value="'. $item->ID .'"' : '';
+                $maybe_classes = ( 'frontend' == $args->context ) ? ' class="'. $css_class .'"' : '';
+                
+                $output .= $indent . '<li id="menu-item-'. $item->ID .'"'. $maybe_value . $maybe_classes .'>' . wp_get_nav_menu_item( $item, $args->context, $args );
+        }
+
+        /**
+         * @see Walker::end_el()
+         * @since 3.0.0
+         *
+         * @param string $output Passed by reference. Used to append additional content.
+         * @param object $item Page data object. Not used.
+         * @param int $depth Depth of page. Not Used.
+         */
+        function end_el(&$output, $item, $depth) {
+                $output .= "</li>\n";
+        }
+
+}
+
+/**
</ins><span class="cx"> * Create HTML list of pages.
</span><span class="cx"> *
</span><span class="cx"> * @package WordPress
</span></span></pre></div>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-includes/nav-menu-template.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -9,13 +9,11 @@
</span><span class="cx"> * menu_class - CSS class to use for the div container of the menu list. Defaults to 'menu'.
</span><span class="cx"> * format - Whether to format the ul. Defaults to 'div'.
</span><span class="cx"> * fallback_cb - If the menu doesn't exists, a callback function will fire. Defaults to 'wp_page_menu'.
</span><del>- * before_link - Output text before the link.
- * after_link - Output text after the link.
- * before_title - Output text before the link text.
- * before_title - Output text after the link text.
</del><ins>+ * before - Text before the link text.
+ * after - Text after the link text.
+ * link_before - Text before the link.
+ * link_after - Text after the link.
</ins><span class="cx"> * echo - Whether to echo the menu or return it. Defaults to echo.
</span><del>- *
- * TODO:
</del><span class="cx"> * show_home - If you set this argument, then it will display the link to the home page. The show_home argument really just needs to be set to the value of the text of the link.
</span><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><span class="lines">@@ -24,7 +22,8 @@
</span><span class="cx"> */
</span><span class="cx"> function wp_nav_menu( $args = array() ) {
</span><span class="cx">         $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'menu_class' => 'menu', 'echo' => true,
</span><del>-        'fallback_cb' => 'wp_page_menu', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', );
</del><ins>+        'fallback_cb' => 'wp_page_menu', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '',
+        'depth' => 0, 'walker' => '' );
</ins><span class="cx">
</span><span class="cx">         $args = wp_parse_args( $args, $defaults );
</span><span class="cx">         $args = apply_filters( 'wp_nav_menu_args', $args );
</span><span class="lines">@@ -83,8 +82,8 @@
</span><span class="cx"> * @return mixed $output False if menu doesn't exists, else, returns the menu.
</span><span class="cx"> **/
</span><span class="cx"> function wp_get_nav_menu( $args = array() ) {
</span><del>-        $defaults = array( 'menu' => '', 'menu_class' => 'menu', 'context' => 'frontend',
-        'fallback_cb' => '', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', );
</del><ins>+        $defaults = array( 'menu' => '', 'menu_class' => 'menu', 'context' => 'frontend', 'depth' => 0,
+        'fallback_cb' => '', 'walker' => '', 'before' => '', 'after' => '', 'link_before' => '', 'link_after' => '', );
</ins><span class="cx">         
</span><span class="cx">         $args = wp_parse_args( $args, $defaults );
</span><span class="cx">         $args = apply_filters( 'wp_get_nav_menu_args', $args );
</span><span class="lines">@@ -93,55 +92,28 @@
</span><span class="cx">         // Variable setup
</span><span class="cx">         $nav_menu = '';
</span><span class="cx">         $items = '';
</span><del>-        $current_parent = 0;
-        $parent_stack = array();
-        $parent_menu_order = array();
</del><span class="cx">         
</span><span class="cx">         // Get the menu object
</span><span class="cx">         $menu = wp_get_nav_menu_object( $args->menu );
</span><span class="cx">         
</span><span class="cx">         // If the menu exists, get it's items.
</span><span class="cx">         if ( $menu && !is_wp_error($menu) )
</span><del>-                $menu_items = wp_get_nav_menu_items( $menu->term_id, 'backend' );
</del><ins>+                $menu_items = wp_get_nav_menu_items( $menu->term_id, $args->context );
</ins><span class="cx">         
</span><span class="cx">         // If no menu was found or if the menu has no items, call the fallback_cb
</span><span class="cx">         if ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) ) {
</span><del>-                if ( function_exists($args->fallback_cb) ) {
-                        $_args = array_merge( (array)$args, array('echo' => false) );
</del><ins>+                if ( function_exists($args->fallback_cb) || is_callable( $args->fallback_cb ) ) {
+                        $_args = array_merge( (array) $args, array('echo' => false) );
</ins><span class="cx">                         return call_user_func( $args->fallback_cb, $_args );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
-        foreach ( $menu_items as $key => $menu_item ) {
-                // Set up the $menu_item variables
-                $menu_item = wp_setup_nav_menu_item( $menu_item, 'frontend' );
-
-                $type = $menu_item->append;
-                $maybe_value = 'frontend' == $args->context ? '' : ' value="'. $menu_item->ID .'"';
-                $classes = 'frontend' == $args->context ? ' class="menu-item-type-'. $type . $menu_item->li_class .'"' : '';
</del><span class="cx">                 
</span><del>-                $items .= '<li id="menu-item-'. $menu_item->ID .'"'. $maybe_value . $classes .'>';
-                $items .= wp_get_nav_menu_item( $menu_item, $args->context, $args );
-                
-                // Indent children
-                $last_item = ( count( $menu_items ) == $menu_item->menu_order );
-                if ( $last_item || $current_parent != $menu_items[$key + 1]->post_parent ) {
-                        if ( $last_item || in_array( $menu_items[$key + 1]->post_parent, $parent_stack ) ) {
-                                $items .= '</li>';
-                                while ( !empty( $parent_stack ) && ($last_item || $menu_items[$key + 1]->post_parent != $current_parent ) ) {
-                                        $items .= '</ul></li>';
-                                        $current_parent = array_pop( $parent_stack );
-                                }
-                        } else {
-                                array_push( $parent_stack, $current_parent );
-                                $current_parent = $menu_item->ID;
-                                $items .= '<ul class="sub-menu">';
-                        }
-                } else {
-                        $items .= '</li>';
-                }
-        }
</del><ins>+        // Set up the $menu_item variables
+        foreach ( (array) $menu_items as $key => $menu_item )
+                $menu_items[$menu_item->menu_order] = wp_setup_nav_menu_item( $menu_item, 'frontend' );
</ins><span class="cx">         
</span><ins>+        $items .= walk_nav_menu_tree( $menu_items, $args->depth, $args );
+        
</ins><span class="cx">         // CSS class
</span><span class="cx">         $ul_class = $args->menu_class ? ' class="'. $args->menu_class .'"' : '';
</span><span class="cx">         $nav_menu .= '<ul'. $ul_class .'>';
</span><span class="lines">@@ -174,93 +146,68 @@
</span><span class="cx">         $output = '';
</span><span class="cx">         switch ( $context ) {
</span><span class="cx">                 case 'frontend':
</span><del>-                        $attributes = ( isset($menu_item->anchor_title) && '' != $menu_item->anchor_title ) ? ' title="'. esc_attr($menu_item->anchor_title) .'"' : '';
</del><ins>+                        $attributes = ( isset($menu_item->attr_title) && '' != $menu_item->attr_title ) ? ' title="'. esc_attr($menu_item->attr_title) .'"' : '';
</ins><span class="cx">                         $attributes .= ( isset($menu_item->target) && '' != $menu_item->target ) ? ' target="'. esc_attr($menu_item->target) .'"' : '';
</span><del>-                        $attributes .= ( isset($menu_item->classes) && '' != $menu_item->classes ) ? ' class="'. esc_attr($menu_item->classes) .'"' : '';
</del><span class="cx">                         $attributes .= ( isset($menu_item->xfn) && '' != $menu_item->xfn ) ? ' rel="'. esc_attr($menu_item->xfn) .'"' : '';
</span><span class="cx">                         $attributes .= ( isset($menu_item->url) && '' != $menu_item->url ) ? ' href="'. esc_attr($menu_item->url) .'"' : '';
</span><span class="cx">                         
</span><del>-                        $output .= esc_html( $args->before_link );
</del><ins>+                        $output .= esc_html( $args->before );
</ins><span class="cx">                         $output .= '<a'. $attributes .'>';
</span><del>-                        $output .= esc_html( $args->before_title . $menu_item->title . $args->after_title );
</del><ins>+                        $output .= esc_html( $args->link_before . apply_filters('the_title', $menu_item->title) . $args->link_after );
</ins><span class="cx">                         $output .= '</a>';
</span><del>-                        $output .= esc_html( $args->after_link );
</del><ins>+                        $output .= esc_html( $args->after );
</ins><span class="cx">                         
</span><span class="cx">                         break;
</span><span class="cx">                 
</span><span class="cx">                 case 'backend':
</span><span class="cx">                         $output .= '<dl><dt>';
</span><del>-                        $output .= '<span class="item-title">'. esc_html($menu_item->title) .'</span>';
</del><ins>+                        $output .= '<span class="item-title">'. esc_html( $menu_item->title ) .'</span>';
</ins><span class="cx">                         $output .= '<span class="item-controls">';
</span><del>-                        if ( 'custom' == $menu_item->type ) {
-                                $label = __('Custom');
-                        } elseif ( 'post_type' == $menu_item->type ) {
-                                $type_obj = get_post_type_object($menu_item->append);
-                                $label = $type_obj->singular_label;
-                        } elseif ( 'taxonomy' == $menu_item->type ) {
-                                $taxonomy = get_taxonomy($menu_item->append);
-                                $label = $taxonomy->singular_label;
-                        } else {
-                                $label = $menu_item->append;
-                        }
-                        $output .= '<span class="item-type">'. esc_html($label) .'</span>';
</del><ins>+                        $output .= '<span class="item-type">'. esc_html( $menu_item->append ) .'</span>';
</ins><span class="cx">                         
</span><span class="cx">                         // Actions
</span><del>-                        $output .= '<a class="item-edit thickbox" id="edit'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->menu_order ) .'" title="'. __('Edit Menu Item') .'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'. __('Edit') .'</a> | ';
-                        $output .= '<a class="item-delete" id="delete'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->menu_order ) .'">'. __('Delete') .'</a>';
</del><ins>+                        $output .= '<a class="item-edit thickbox" id="edit-'. esc_attr( $menu_item->ID ) .'" value="'. esc_attr( $menu_item->ID ) .'" title="'. __('Edit Menu Item') .'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'. __('Edit') .'</a> | ';
+                        $output .= '<a class="item-delete" id="delete-'. esc_attr( $menu_item->ID ) .'" value="'. esc_attr( $menu_item->ID ) .'">'. __('Delete') .'</a>';
</ins><span class="cx">                         
</span><del>-                        $output .= '</dt></dl>';
</del><ins>+                        $output .= '</span></dt></dl>';
</ins><span class="cx">                         
</span><span class="cx">                         // Menu Item Settings
</span><del>-                        $output .= '<input type="hidden" name="menu-item-db-id[]" id="menu-item-db-id'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->ID ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-object-id[]" id="menu-item-object-id'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->object_id ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-parent-id[]" id="menu-item-parent-id'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->post_parent ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-position[]" id="menu-item-position'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->menu_order ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-type[]" id="menu-item-type'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->type ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-append[]" id="menu-item-append'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->append ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-title[]" id="menu-item-title'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->title ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-url[]" id="menu-item-url'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->url ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-description[]" id="menu-item-description'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->description ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-classes[]" id="menu-item-classes'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->classes ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-xfn[]" id="menu-item-xfn'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->xfn ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-attr-title[]" id="menu-item-attr-title'. esc_attr( $menu_item->menu_order ) .'" value="'.esc_attr( $menu_item->post_excerpt ) .'" />';
-                        $output .= '<input type="hidden" name="menu-item-target[]" id="menu-item-target'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->target ) .'" />';
</del><ins>+                        $output .= '<input type="hidden" name="menu-item-db-id[]" value="'. esc_attr( $menu_item->ID ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-object-id[]" value="'. esc_attr( $menu_item->object_id ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-object[]" value="'. esc_attr( $menu_item->object ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-parent-id[]" value="'. esc_attr( $menu_item->post_parent ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-position[]" value="'. esc_attr( $menu_item->menu_order ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-type[]" value="'. esc_attr( $menu_item->type ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-title[]" value="'. esc_attr( $menu_item->title ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-url[]" value="'. esc_attr( $menu_item->url ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-description[]" value="'. esc_attr( $menu_item->description ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-classes[]" value="'. esc_attr( $menu_item->classes ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-xfn[]" value="'. esc_attr( $menu_item->xfn ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-attr-title[]" value="'.esc_attr( $menu_item->post_excerpt ) .'" />';
+                        $output .= '<input type="hidden" name="menu-item-target[]" value="'. esc_attr( $menu_item->target ) .'" />';
</ins><span class="cx">                         break;
</span><span class="cx">                 
</span><span class="cx">                 case 'custom':
</span><del>-                        $menu_id = 'menu-item-' . $menu_item->db_id;
-                        $output .= '<label class="menu-item-title"><input type="checkbox" id="'. esc_attr( $menu_id ) .'" name="'. esc_attr( $menu_item->title ) .'" value="'. esc_attr( $menu_item->url ) .'" />'. $menu_item->title .'</label>';
</del><ins>+                case 'taxonomy':
+                case 'post_type':
+                        $output .= '<label class="menu-item-title"><input type="checkbox" id="'. esc_attr( 'menu-item-' . $menu_item->object_id ) .'" value="'. esc_attr( $menu_item->url ) .'" />'. $menu_item->title .'</label>';
</ins><span class="cx">                         
</span><span class="cx">                         // Menu item hidden fields
</span><del>-                        $output .= '<input type="hidden" class="menu-item-db-id" value="'. esc_attr( $menu_item->db_id ) .'" />';
</del><ins>+                        $output .= '<input type="hidden" class="menu-item-db-id" value="0" />';
</ins><span class="cx">                         $output .= '<input type="hidden" class="menu-item-object-id" value="'. esc_attr( $menu_item->object_id ) .'" />';
</span><del>-                        $output .= '<input type="hidden" class="menu-item-parent-id" value="'. esc_attr( $menu_item->parent_id ) .'" />';
</del><ins>+                        $output .= '<input type="hidden" class="menu-item-object" value="'. esc_attr( $menu_item->object ) .'" />';
+                        $output .= '<input type="hidden" class="menu-item-parent-id" value="'. esc_attr( $menu_item->post_parent ) .'" />';
</ins><span class="cx">                         $output .= '<input type="hidden" class="menu-item-type" value="'. esc_attr( $menu_item->type ) .'" />';
</span><span class="cx">                         $output .= '<input type="hidden" class="menu-item-append" value="'. esc_attr( $menu_item->append ) .'" />';
</span><span class="cx">                         $output .= '<input type="hidden" class="menu-item-title" value="'. esc_attr( $menu_item->title ) .'" />';
</span><span class="cx">                         $output .= '<input type="hidden" class="menu-item-url" value="'. esc_attr( $menu_item->url ) .'" />';
</span><ins>+                        $output .= '<input type="hidden" class="menu-item-append" value="'. esc_attr( $menu_item->append ) .'" />';
</ins><span class="cx">                         $output .= '<input type="hidden" class="menu-item-target" value="'. esc_attr( $menu_item->target ) .'" />';
</span><span class="cx">                         $output .= '<input type="hidden" class="menu-item-attr_title" value="'. esc_attr( $menu_item->attr_title ) .'" />';
</span><span class="cx">                         $output .= '<input type="hidden" class="menu-item-description" value="'. esc_attr( $menu_item->description ) .'" />';
</span><span class="cx">                         $output .= '<input type="hidden" class="menu-item-classes" value="'. esc_attr( $menu_item->classes ) .'" />';
</span><span class="cx">                         $output .= '<input type="hidden" class="menu-item-xfn" value="'. esc_attr( $menu_item->xfn ) .'" />';
</span><span class="cx">                         break;
</span><del>-                
-                case 'taxonomy':
-                case 'post_type':
-                        $menu_id = 'menu-item-' . $menu_item->db_id;
-                        $output .= '<label class="menu-item-title"><input type="checkbox" id="'. esc_attr( $menu_id ) .'" name="'. esc_attr( $menu_item->title ) .'" value="'. esc_attr( $menu_item->url ) .'" />'. $menu_item->title .'</label>';
-                        
-                        // Menu item hidden fields
-                        $output .= '<input type="hidden" class="menu-item-db-id" value="0" />';
-                        $output .= '<input type="hidden" class="menu-item-object-id" value="'. esc_attr( $menu_item->object_id ) .'" />';
-                        $output .= '<input type="hidden" class="menu-item-parent-id" value="'. esc_attr( $menu_item->parent_id ) .'" />';
-                        $output .= '<input type="hidden" class="menu-item-type" value="'. esc_attr( $menu_item->type ) .'" />';
-                        $output .= '<input type="hidden" class="menu-item-append" value="'. esc_attr( $menu_item->append ) .'" />';
-                        $output .= '<input type="hidden" class="menu-item-title" value="'. esc_attr( $menu_item->title ) .'" />';
-                        $output .= '<input type="hidden" class="menu-item-url" value="'. esc_attr( $menu_item->url ) .'" />';
-                        $output .= '<input type="hidden" class="menu-item-append" value="'. esc_attr( $menu_item->append ) .'" />';
-                        break;
</del><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         return $output;
</span></span></pre></div>
<a id="trunkwpincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-includes/nav-menu.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -8,26 +8,26 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Returns a Navigation Menu object
</del><ins>+ * Returns a navigation menu object.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> *
</span><span class="cx"> * @param string $menu Menu id
</span><del>- * @return mixed $menu|false
</del><ins>+ * @return mixed $menu|false Or WP_Error
</ins><span class="cx"> */
</span><span class="cx"> function wp_get_nav_menu_object( $menu ) {
</span><span class="cx">         return is_nav_menu( $menu );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Check if Menu exists.
</del><ins>+ * Check if navigation menu exists.
</ins><span class="cx"> *
</span><span class="cx"> * Returns the menu object, or false if the term doesn't exist.
</span><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> *
</span><span class="cx"> * @param int|string $menu The menu to check
</span><del>- * @return mixed Menu Object, if exists.
</del><ins>+ * @return mixed Menu Object, if it exists. Else, false or WP_Error
</ins><span class="cx"> */
</span><span class="cx"> function is_nav_menu( $menu ) {
</span><span class="cx">         if ( !$menu )
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Creates a navigation menu.
</del><ins>+ * Create a Navigation Menu.
</ins><span class="cx"> *
</span><span class="cx"> * Optional args:
</span><span class="cx"> * slug - the url friendly version of the nav menu.
</span><span class="lines">@@ -58,13 +58,13 @@
</span><span class="cx"> *
</span><span class="cx"> * @param string $menu_name Menu Name
</span><span class="cx"> * @param string $args Optional.
</span><del>- * @return mixed Menu object|WP_Error
</del><ins>+ * @return mixed Menu object on sucess|WP_Error on failure
</ins><span class="cx"> */
</span><span class="cx"> function wp_create_nav_menu( $menu_name, $args = array() ) {
</span><span class="cx">         $menu_exists = get_term_by( 'name', $menu_name, 'nav_menu' );
</span><span class="cx">
</span><span class="cx">         if ( $menu_exists )
</span><del>-                return new WP_Error( 'menu_exists', sprintf( __('A menu named &#8220;%s&#8221; already exists; please try another name.'), esc_html( $menu_exists->name ) ) );
</del><ins>+                return new WP_Error( 'menu_exists', sprintf( __('A menu named <strong>%s</strong> already exists; please try another name.'), esc_html( $menu_exists->name ) ) );
</ins><span class="cx">
</span><span class="cx">         if ( isset($args['slug']) )
</span><span class="cx">                 $slug = $args['slug'];
</span><span class="lines">@@ -76,16 +76,23 @@
</span><span class="cx">         if ( is_wp_error($menu) )
</span><span class="cx">                 return $menu;
</span><span class="cx">
</span><del>-        return get_term( $menu['term_id'], 'nav_menu') ;
</del><ins>+        $result = get_term( $menu['term_id'], 'nav_menu' );
+        
+        if ( $result && !is_wp_error($result) ) {
+                do_action( 'wp_create_nav_menu', $menu['term_id'] );
+                return $result;
+        } else {
+                return $result;
+        }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Deletes a navigation menu.
</del><ins>+ * Delete a Navigation Menu.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> *
</span><span class="cx"> * @param string $menu name|id|slug
</span><del>- * @return bool true on success, else false.
</del><ins>+ * @return mixed Menu object on sucess|WP_Error on failure
</ins><span class="cx"> */
</span><span class="cx"> function wp_delete_nav_menu( $menu ) {
</span><span class="cx">         $menu = wp_get_nav_menu_object( $menu );
</span><span class="lines">@@ -98,11 +105,19 @@
</span><span class="cx">                         wp_delete_post( $item );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        wp_delete_term( $menu->term_id, 'nav_menu' );
</del><ins>+        
+        $result = wp_delete_term( $menu->term_id, 'nav_menu' );
+        
+        if ( $result && !is_wp_error($result) ) {
+                do_action( 'wp_delete_nav_menu', $menu->term_id );
+                return $result;
+        } else {
+                return $result;
+        }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Returns all Navigation Menu objects.
</del><ins>+ * Returns all navigation menu objects.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> *
</span><span class="lines">@@ -153,62 +168,85 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Adds all the nav menu properties to the $menu_item.
</del><ins>+ * Retrieve the HTML list content for nav menu items.
</ins><span class="cx"> *
</span><ins>+ * @uses Walker_Nav_Menu to create HTML list content.
+ * @since 2.1.0
+ * @see Walker::walk() for parameters and return description.
+ */
+function walk_nav_menu_tree( $items, $depth, $r ) {
+        $walker = ( empty($r->walker) ) ? new Walker_Nav_Menu : $r->walker;
+        $args = array( $items, $depth, $r );
+        
+        return call_user_func_array(array(&$walker, 'walk'), $args);
+}
+
+/**
+ * Adds all the navigation menu properties to the menu item.
+ *
</ins><span class="cx"> * @since 3.0.0
</span><span class="cx"> *
</span><span class="cx"> * @param string $menu_item The menu item to modify
</span><del>- * @param string $menu_item_type The menu item type (template, custom, post_type, taxonomy).
</del><ins>+ * @param string $menu_item_type The menu item type (frontend, custom, post_type, taxonomy).
</ins><span class="cx"> * @param string $menu_item_object Optional. The menu item object type (post type or taxonomy).
</span><del>- * @return object $menu_item The modtified menu item.
</del><ins>+ * @return object $menu_item The modified menu item.
</ins><span class="cx"> */
</span><span class="cx"> function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_object = '' ) {
</span><del>-        global $wp_query;
-
</del><span class="cx">         switch ( $menu_item_type ) {
</span><span class="cx">                 case 'frontend':
</span><span class="cx">                         $menu_item->db_id = (int) $menu_item->ID;
</span><del>-                        $menu_item->object_id = get_post_meta( $menu_item->ID, 'menu_item_object_id', true );
-                        $menu_item->parent_id = (int) $menu_item->post_parent;
-                        $menu_item->type = get_post_meta( $menu_item->ID, 'menu_item_type', true );
-
-                        $menu_item->append = get_post_meta( $menu_item->ID, 'menu_item_append', true );
-
</del><ins>+                        $menu_item->object_id = get_post_meta( $menu_item->ID, '_menu_item_object_id', true );
+                        $menu_item->object = get_post_meta( $menu_item->ID, '_menu_item_object', true );
+                        $menu_item->type = get_post_meta( $menu_item->ID, '_menu_item_type', true );
+                        
+                        if ( 'post_type' == $menu_item->type ) {
+                                $object = get_post_type_object( $menu_item->object );
+                                $menu_item->append = $object->singular_label;
+                                
+                        } elseif ( 'taxonomy' == $menu_item->type ) {
+                                $object = get_taxonomy( $menu_item->object );
+                                $menu_item->append = $object->singular_label;
+                                
+                        } else {
+                                $menu_item->append = __('Custom');
+                        }
+                        
</ins><span class="cx">                         $menu_item->title = $menu_item->post_title;
</span><del>-                        $menu_item->url = get_post_meta( $menu_item->ID, 'menu_item_url', true );
-                        $menu_item->target = get_post_meta( $menu_item->ID, 'menu_item_target', true );
</del><ins>+                        $menu_item->url = get_post_meta( $menu_item->ID, '_menu_item_url', true );
+                        $menu_item->target = get_post_meta( $menu_item->ID, '_menu_item_target', true );
</ins><span class="cx">
</span><span class="cx">                         $menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
</span><span class="cx">                         $menu_item->description = strip_tags( $menu_item->post_content );
</span><span class="cx">
</span><del>-                        $menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true );;
-                        $menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true );
-                        $menu_item->li_class = ( $menu_item->object_id == $wp_query->get_queried_object_id() ) ? ' current_page_item' : '';
</del><ins>+                        $menu_item->classes = get_post_meta( $menu_item->ID, '_menu_item_classes', true );;
+                        $menu_item->xfn = get_post_meta( $menu_item->ID, '_menu_item_xfn', true );
</ins><span class="cx">                         break;
</span><span class="cx">
</span><span class="cx">                 case 'custom':
</span><del>-                        $menu_item->db_id = (int) $menu_item->ID;
</del><ins>+                        $menu_item->db_id = 0;
</ins><span class="cx">                         $menu_item->object_id = (int) $menu_item->ID;
</span><del>-                        $menu_item->parent_id = (int) $menu_item->post_parent;
-                        $menu_item->type = 'custom'; //$menu_item_type
-                        $menu_item->append = 'custom';
</del><ins>+                        $menu_item->object = 'custom';
+                        $menu_item->type = 'custom';
+                        $menu_item->append = __('custom');
</ins><span class="cx">
</span><span class="cx">                         $menu_item->attr_title = strip_tags( $menu_item->post_excerpt );
</span><span class="cx">                         $menu_item->description = strip_tags( $menu_item->post_content );
</span><span class="cx">
</span><span class="cx">                         $menu_item->title = $menu_item->post_title;
</span><del>-                        $menu_item->url = get_post_meta( $menu_item->ID, 'menu_item_url', true );
-                        $menu_item->target = get_post_meta( $menu_item->ID, 'menu_item_target', true );
</del><ins>+                        $menu_item->url = get_post_meta( $menu_item->ID, '_menu_item_url', true );
+                        $menu_item->target = get_post_meta( $menu_item->ID, '_menu_item_target', true );
+                        $menu_item->classes = '';
+                        $menu_item->xfn = '';
</ins><span class="cx">                         break;
</span><span class="cx">
</span><span class="cx">                 case 'post_type':
</span><span class="cx">                         $menu_item->db_id = 0;
</span><span class="cx">                         $menu_item->object_id = (int) $menu_item->ID;
</span><del>-                        $menu_item->parent_id = (int) $menu_item->post_parent;
</del><span class="cx">                         $menu_item->type = $menu_item_type;
</span><span class="cx">
</span><span class="cx">                         $object = get_post_type_object( $menu_item_object );
</span><del>-                        $menu_item->append = $object->name;
</del><ins>+                        $menu_item->object = $object->name;
+                        $menu_item->append = strtolower( $object->singular_label );
</ins><span class="cx">
</span><span class="cx">                         $menu_item->title = $menu_item->post_title;
</span><span class="cx">                         $menu_item->url = get_permalink( $menu_item->ID );
</span><span class="lines">@@ -216,29 +254,30 @@
</span><span class="cx">
</span><span class="cx">                         $menu_item->attr_title = '';
</span><span class="cx">                         $menu_item->description = strip_tags( $menu_item->post_content );
</span><ins>+                        $menu_item->classes = '';
+                        $menu_item->xfn = '';
</ins><span class="cx">                         break;
</span><span class="cx">
</span><span class="cx">                 case 'taxonomy':
</span><span class="cx">                         $menu_item->ID = $menu_item->term_id;
</span><span class="cx">                         $menu_item->db_id = 0;
</span><span class="cx">                         $menu_item->object_id = (int) $menu_item->term_id;
</span><del>-                        $menu_item->parent_id = (int) $menu_item->parent;
</del><ins>+                        $menu_item->post_parent = (int) $menu_item->parent;
</ins><span class="cx">                         $menu_item->type = $menu_item_type;
</span><span class="cx">
</span><span class="cx">                         $object = get_taxonomy( $menu_item_object );
</span><del>-                        $menu_item->append = $object->name;
</del><ins>+                        $menu_item->object = $object->name;
+                        $menu_item->append = strtolower( $object->singular_label );
</ins><span class="cx">
</span><span class="cx">                         $menu_item->title = $menu_item->name;
</span><span class="cx">                         $menu_item->url = get_term_link( $menu_item, $menu_item_object );
</span><span class="cx">                         $menu_item->target = '_self';
</span><span class="cx">                         $menu_item->attr_title = '';
</span><span class="cx">                         $menu_item->description = strip_tags( $menu_item->description );
</span><ins>+                        $menu_item->classes = '';
+                        $menu_item->xfn = '';
</ins><span class="cx">                         break;
</span><del>-        }
-
-        $menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true );
-        $menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true );
-
</del><ins>+        }        
</ins><span class="cx">         return $menu_item;
</span><span class="cx"> }
</span><span class="cx"> ?>
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-includes/post.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -63,7 +63,9 @@
</span><span class="cx">                                                                                         'query_var' => false,
</span><span class="cx">                                                                                 ) );
</span><span class="cx">
</span><del>-        register_post_type( 'nav_menu_item', array(        'public' => false,
</del><ins>+        register_post_type( 'nav_menu_item', array(        'label' => __('Navigation Menu Items'),
+                                                                                                'singular_label' => __('Navigation Menu Item'),
+                                                                                                'public' => false,
</ins><span class="cx">                                                                                                 'show_ui' => false,
</span><span class="cx">                                                                                                 '_builtin' => true,
</span><span class="cx">                                                                                                 'capability_type' => 'post',
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-includes/script-loader.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -397,11 +397,9 @@
</span><span class="cx">                 ) );
</span><span class="cx">
</span><span class="cx">                 // Custom Navigation
</span><del>-                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100317b' );
</del><ins>+                $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100322' );
</ins><span class="cx">                 $scripts->localize( 'nav-menu', 'navMenuL10n', array(
</span><span class="cx">                         'custom' => _x('Custom', 'menu nav item type'),
</span><del>-                        'page' => _x('Page', 'menu nav item type'),
-                        'category' => _x('Category', 'menu nav item type'),
</del><span class="cx">                         'thickbox' => _x('Edit Menu Item', 'Thickbox Title'),
</span><span class="cx">                         'edit' => _x('Edit', 'menu item edit text'),
</span><span class="cx">                         'warnDelete' => __( "You are about to permanently delete this menu. \n 'Cancel' to stop, 'OK' to delete." ),
</span><span class="lines">@@ -410,7 +408,6 @@
</span><span class="cx">                 $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20100321' );
</span><span class="cx">                 $scripts->add_data( 'custom-background', 'group', 1 );
</span><span class="cx">                 // See wp_just_in_time_script_localization() for translation data for this object
</span><del>-
</del><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludestaxonomyphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/taxonomy.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/taxonomy.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-includes/taxonomy.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -39,6 +39,8 @@
</span><span class="cx">                                                                                                 ) ) ;
</span><span class="cx">
</span><span class="cx">         register_taxonomy( 'nav_menu', 'nav_menu_item', array(        'hierarchical' => false,
</span><ins>+                                                                                                                'label' => __('Navigation Menus'),
+                                                                                                                'singular_label' => __('Navigation Menu'),
</ins><span class="cx">                                                                                                                 'query_var' => false,
</span><span class="cx">                                                                                                                 'rewrite' => false,
</span><span class="cx">                                                                                                                 'show_ui' => false,
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (13801 => 13802)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2010-03-22 16:06:55 UTC (rev 13801)
+++ trunk/wp-includes/version.php        2010-03-22 19:56:16 UTC (rev 13802)
</span><span class="lines">@@ -15,7 +15,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @global int $wp_db_version
</span><span class="cx"> */
</span><del>-$wp_db_version = 13576;
</del><ins>+$wp_db_version = 13802;
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * Holds the TinyMCE version
</span></span></pre>
</div>
</div>
</body>
</html>