<!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>[13375] trunk: Nav menu cleanups.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13375">13375</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-02-24 18:52:54 +0000 (Wed, 24 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Nav menu cleanups. Props nbachiyski. see <a href="http://trac.wordpress.org/ticket/11817">#11817</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincsscustomnavigationcss">trunk/wp-admin/css/custom-navigation.css</a></li>
<li><a href="#trunkwpadmincsscustomnavigationdevcss">trunk/wp-admin/css/custom-navigation.dev.css</a></li>
<li><a href="#trunkwpadminincludesnavmenuphp">trunk/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunkwpadminjscustomnavigationdynamicfunctionsdevjs">trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js</a></li>
<li><a href="#trunkwpadminjscustomnavigationdynamicfunctionsjs">trunk/wp-admin/js/custom-navigation-dynamic-functions.js</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
<li><a href="#trunkwpincludesdefaultwidgetsphp">trunk/wp-includes/default-widgets.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="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincsscustomnavigationcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/custom-navigation.css (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/custom-navigation.css        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/css/custom-navigation.css        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -1 +1 @@
</span><del>-.fix{clear:both;height:1px;margin:-1px 0 0;overflow:hidden;}.maintitle{margin:0 0 20px 0!important;}.logo{vertical-align:middle;margin:0 10px 0 0;}#pages-left{min-width:650px;max-width:1100px;width:100%;float:left;clear:left;margin-right:-315px;}#pages-left .inside{margin-top:20px;margin-right:315px;}#nav-container{margin-top:-3px;}.sidebar-name{background-color:#AAA;background-image:url(../images/ed-bg.gif);border-color:#DFDFDF;text-shadow:0 1px 0 #FFF;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;background-position:0 0;background-repeat:repeat-x;border-style:solid;border-width:1px;cursor:pointer;font-size:13px;}.sidebar-name h3{font-size:13px;height:19px;margin:0;overflow:hidden;padding:5px 12px;white-space:nowrap;}.sidebar-name-arrow{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;float:right;height:29px;width:26px;}#menu-right{width:285px;margin-top:20px;margin-right:10px;margin-left:20px;float:left;clear:right;}h2.heading{margin:32px 0 10px 0;}.widgets-holder-wrap{margin:0 0 20px 0;}.widget-holder{padding:15px 10px;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;border-style:none solid solid;border-width:0 1px 1px;background-color:#F1F1F1;border-color:#DDD;}.checkboxes{float:right;margin:10px 12px 0 0;}.addtomenu{display:block;float:right;margin:10px 0 0 0;text-shadow:0 -1px 0 rgba(0,0,0,0.3);background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#298CBA!important;color:#FFF!important;font-weight:bold;-moz-border-radius-bottomleft:11px;-moz-border-radius-bottomright:11px;-moz-border-radius-topleft:11px;-moz-border-radius-topright:11px;border-style:solid;border-width:1px;cursor:pointer;font-size:11px!important;line-height:16px;padding:2px 8px;text-decoration:none;}.list{zoom:1;}.list li{margin:0;}.list dt{display:none;float:left;width:260px;margin:0;padding:0 0 0 5px;line-height:30px;border-bottom:1px solid #e3e3e3;}.list dt span{float:left;}.list dt img{cursor:pointer;float:right;margin:7px 5px 0 0;}#nav-container{padding:0 10px 10px 10px;background-color:#fff;border:1px solid #DFDFDF;border-top:none;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;}#custom-nav ul{width:100%;}#custom-nav li{margin:0;}.ui-draggable-dragging{width:500px;}#custom-nav 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;}#custom-nav li dl dt:hover{cursor:move;}#custom-nav li dl dt .controls{position:absolute;right:15px;top:-1px;}#custom-nav li dl dt img{vertical-align:middle;}#custom-nav li .title{background:url(../images/ico-arrow.png) no-repeat 4px 5px;padding-left:15px;}#custom-nav li ul li{margin-left:20px;opacity:.7;}#custom-nav li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li ul li{opacity:.95;}#existing-pages li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-pages li ul li .title{margin-left:10px;}#existing-pages li ul li ul li .title{margin-left:20px;}#existing-pages li ul li ul li ul li .title{margin-left:30px;}#existing-pages li ul li ul li ul li ul li .title{margin-left:40px;}#existing-pages li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-pages li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}#existing-categories li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-categories li ul li .title{margin-left:10px;}#existing-categories li ul li ul li .title{margin-left:20px;}#existing-categories li ul li ul li ul li .title{margin-left:30px;}#existing-categories li ul li ul li ul li ul li .title{margin-left:40px;}#existing-categories li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-categories li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}img.remove,img.edit{cursor:pointer;margin:0 5px 0 0;}.dropzone{height:7px;margin:3px 0 3px 0;}.hide{display:none;}.type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}#menu_select{width:170px;}#dialog-confirm label{padding-left:10px;}.ui-dialog{background:#fff;border:1px solid #555;-moz-box-shadow:0 4px 30px #000;}.ui-dialog-titlebar{color:#CFCFCF;font-family:&quot;Lucida Grande&quot;,Verdana,Arial,sans-serif;padding:6px 10px 6px;background-color:#222!important;border:none!important;-moz-border-radius:none!important;}#dialog-confirm{height:168px!important;padding:20px 10px 10px;}#dialog-confirm input{margin:0 0 15px 0;width:280px;}#dialog-confirm select{margin:0 0 15px 0;}.ui-dialog-buttonpane{padding:10px;}.ui-dialog-buttonpane button{margin:0 10px 0 0;background:#F2F2F2;text-shadow:0 1px 0 #FFF;border-color:#BBB;color:#464646;-moz-border-radius-bottomleft:11px;-moz-border-radius-bottomright:11px;-moz-border-radius-topleft:11px;-moz-border-radius-topright:11px;border-style:solid;border-width:1px;cursor:pointer;font-size:11px!important;line-height:14px;padding:2px 8px;text-decoration:none;}.ui-dialog-buttonpane button:hover{color:#000;border-color:#666;}.ui-icon{display:none;}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);-moz-border-radius:8px;-webkit-border-radius:8px;}#reset_wp_menu{background:#c77 none!important;color:white!important;text-shadow:0 1px 0 #555!important;}
</del><span class="cx">\ No newline at end of file
</span><ins>+.fix{clear:both;height:1px;margin:-1px 0 0;overflow:hidden;}.maintitle{margin:0 0 20px 0!important;}.logo{vertical-align:middle;margin:0 10px 0 0;}#pages-left{min-width:650px;max-width:1100px;width:100%;float:left;clear:left;margin-right:-315px;}#pages-left .inside{margin-top:20px;margin-right:315px;}#nav-container{margin-top:-3px;}.sidebar-name{background-color:#AAA;background-image:url(../images/ed-bg.gif);border-color:#DFDFDF;text-shadow:0 1px 0 #FFF;-moz-border-radius-topleft:8px;-moz-border-radius-topright:8px;background-position:0 0;background-repeat:repeat-x;border-style:solid;border-width:1px;cursor:pointer;font-size:13px;}.sidebar-name h3{font-size:13px;height:19px;margin:0;overflow:hidden;padding:5px 12px;white-space:nowrap;}.sidebar-name-arrow{background:transparent url(../images/menu-bits.gif) no-repeat scroll left -109px;float:right;height:29px;width:26px;}#menu-right{width:285px;margin-top:20px;margin-right:10px;margin-left:20px;float:left;clear:right;}h2.heading{margin:32px 0 10px 0;}.widgets-holder-wrap{margin:0 0 20px 0;}.widget-holder{padding:15px 10px;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;border-style:none solid solid;border-width:0 1px 1px;background-color:#F1F1F1;border-color:#DDD;}.checkboxes{float:right;margin:10px 12px 0 0;}.addtomenu{display:block;float:right;margin:10px 0 0 0;text-shadow:0 -1px 0 rgba(0,0,0,0.3);background:#21759B url(../images/button-grad.png) repeat-x scroll left top;border-color:#298CBA!important;color:#FFF!important;font-weight:bold;-moz-border-radius-bottomleft:11px;-moz-border-radius-bottomright:11px;-moz-border-radius-topleft:11px;-moz-border-radius-topright:11px;border-style:solid;border-width:1px;cursor:pointer;font-size:11px!important;line-height:16px;padding:2px 8px;text-decoration:none;}.list{zoom:1;}.list li{margin:0;}.list dt{display:none;float:left;width:260px;margin:0;padding:0 0 0 5px;line-height:30px;border-bottom:1px solid #e3e3e3;}.list dt span{float:left;}.list dt img{cursor:pointer;float:right;margin:7px 5px 0 0;}#nav-container{padding:0 10px 10px 10px;background-color:#fff;border:1px solid #DFDFDF;border-top:none;-moz-border-radius-bottomleft:8px;-moz-border-radius-bottomright:8px;}#custom-nav ul{width:100%;}#custom-nav li{margin:0;}.ui-draggable-dragging{width:500px;}#custom-nav 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;}#custom-nav li dl dt:hover{cursor:move;}#custom-nav li dl dt .controls{position:absolute;right:15px;top:-1px;}#custom-nav li dl dt img{vertical-align:middle;}#custom-nav li .title{background:url(../images/ico-arrow.png) no-repeat 4px 5px;padding-left:15px;}#custom-nav li ul li{margin-left:20px;opacity:.7;}#custom-nav li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li{opacity:.9;}#custom-nav li ul li ul li ul li ul li{opacity:.95;}#existing-pages li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-pages li ul li .title{margin-left:10px;}#existing-pages li ul li ul li .title{margin-left:20px;}#existing-pages li ul li ul li ul li .title{margin-left:30px;}#existing-pages li ul li ul li ul li ul li .title{margin-left:40px;}#existing-pages li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-pages li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-pages li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}#existing-categories li .title{background:url(../images/ico-arrow.png) no-repeat 4px 13px;padding-left:15px;}#existing-categories li ul li .title{margin-left:10px;}#existing-categories li ul li ul li .title{margin-left:20px;}#existing-categories li ul li ul li ul li .title{margin-left:30px;}#existing-categories li ul li ul li ul li ul li .title{margin-left:40px;}#existing-categories li ul li ul li ul li ul li ul li .title{margin-left:50px;}#existing-categories li ul li ul li ul li ul li ul li ul li .title{margin-left:60px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:70px;}#existing-categories li ul li ul li ul li ul li ul li ul li ul li ul li .title{margin-left:80px;}img.remove,img.edit{cursor:pointer;margin:0 5px 0 0;}.dropzone{height:7px;margin:3px 0 3px 0;}.hide{display:none;}.type{text-transform:uppercase;font-size:11px;color:#999;padding-right:10px;}#menu_select{width:170px;}#dialog-confirm label{padding-left:10px;}.ui-dialog{background:#fff;border:1px solid #555;-moz-box-shadow:0 4px 30px #000;}.ui-dialog-titlebar{color:#CFCFCF;font-family:&quot;Lucida Grande&quot;,Verdana,Arial,sans-serif;padding:6px 10px 6px;background-color:#222!important;border:none!important;-moz-border-radius:none!important;}#dialog-confirm{height:168px!important;padding:20px 10px 10px;}#dialog-confirm input{margin:0 0 15px 0;width:280px;}#dialog-confirm select{margin:0 0 15px 0;}.ui-dialog-buttonpane{padding:10px;}.ui-dialog-buttonpane button{margin:0 10px 0 0;background:#F2F2F2;text-shadow:0 1px 0 #FFF;border-color:#BBB;color:#464646;-moz-border-radius-bottomleft:11px;-moz-border-radius-bottomright:11px;-moz-border-radius-topleft:11px;-moz-border-radius-topright:11px;border-style:solid;border-width:1px;cursor:pointer;font-size:11px!important;line-height:14px;padding:2px 8px;text-decoration:none;}.ui-dialog-buttonpane button:hover{color:#000;border-color:#666;}.ui-icon{display:none;}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%;}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.60;filter:Alpha(Opacity=60);-moz-border-radius:8px;-webkit-border-radius:8px;}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpadmincsscustomnavigationdevcss"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/css/custom-navigation.dev.css (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/css/custom-navigation.dev.css        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/css/custom-navigation.dev.css        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -161,6 +161,3 @@
</span><span class="cx"> .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
</span><span class="cx"> .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); }
</span><span class="cx"> .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 8px; -webkit-border-radius: 8px; }
</span><del>-
-
-#reset_wp_menu { background:#c77 none !important;color:white!important;text-shadow:0 1px 0 #555 !important;}
</del></span></pre></div>
<a id="trunkwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/nav-menu.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/includes/nav-menu.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -29,27 +29,27 @@
</span><span class="cx">         //GET all pages
</span><span class="cx">         $pages_array = get_pages($pages_args);
</span><span class="cx"> 
</span><del>-        $intCounter = $counter;
-        $parentli = $intCounter;
</del><ins>+        $items_counter = $counter;
+        $parentli = $items_counter;
</ins><span class="cx"> 
</span><span class="cx">         if ( !$pages_array ) {
</span><del>-                echo 'Not Found';
-                return $intCounter;
</del><ins>+                echo __('Not Found');
+                return $items_counter;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Display Loop
</span><span class="cx">         foreach ( $pages_array as $post ) {
</span><span class="cx">                 if ( $post-&gt;post_parent == 0 ) {
</span><del>-                        $post = wp_setup_nav_menu_item($post, 'page', $intCounter);
</del><ins>+                        $post = wp_setup_nav_menu_item($post, 'page', $items_counter);
</ins><span class="cx">                         if ( $type == 'menu' ) {
</span><span class="cx">                                 ?&gt;
</span><span class="cx"> 
</span><del>-                                &lt;li id=&quot;menu-&lt;?php echo $intCounter; ?&gt;&quot; value=&quot;&lt;?php echo $intCounter; ?&gt;&quot;&gt;
</del><ins>+                                &lt;li id=&quot;menu-&lt;?php echo $items_counter; ?&gt;&quot; value=&quot;&lt;?php echo $items_counter; ?&gt;&quot;&gt;
</ins><span class="cx">                                         &lt;?php
</span><del>-                                                wp_print_nav_menu_item($post, 'menu', $intCounter);
</del><ins>+                                                wp_print_nav_menu_item($post, 'menu', $items_counter);
</ins><span class="cx">                                                 $parentli = $post-&gt;ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_custom_navigation_default_sub_items($post-&gt;ID, $intCounter, $parentli, 'pages', 'menu');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_custom_navigation_default_sub_items($post-&gt;ID, $items_counter, $parentli, 'pages', 'menu');
</ins><span class="cx">                                         ?&gt;
</span><span class="cx">                                 &lt;/li&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -61,8 +61,8 @@
</span><span class="cx">                                         &lt;?php
</span><span class="cx">                                                 wp_print_nav_menu_item($post, 'default');
</span><span class="cx">                                                 $parentli = $post-&gt;ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_nav_menu_sub_items($post-&gt;ID, $intCounter, $parentli, 'pages', 'default');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_nav_menu_sub_items($post-&gt;ID, $items_counter, $parentli, 'pages', 'default');
</ins><span class="cx">                                          ?&gt;
</span><span class="cx">                                 &lt;/li&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        return $intCounter;
</del><ins>+        return $items_counter;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Outputs All Categories and Sub Items
</span><span class="lines">@@ -90,30 +90,30 @@
</span><span class="cx">                         'number'                   =&gt; '',
</span><span class="cx">                         'pad_counts'               =&gt; false );
</span><span class="cx"> 
</span><del>-        $intCounter = $counter;
</del><ins>+        $items_counter = $counter;
</ins><span class="cx"> 
</span><span class="cx">         // Get all categories
</span><span class="cx">         $categories_array = get_categories($category_args);
</span><span class="cx"> 
</span><span class="cx">         if ( !$categories_array ) {
</span><span class="cx">                 _e('Not Found');
</span><del>-                return $intCounter;
</del><ins>+                return $items_counter;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Display Loop
</span><span class="cx">         foreach ( $categories_array as $cat_item ) {
</span><span class="cx">                 if ( $cat_item-&gt;parent == 0 ) {
</span><del>-                        $cat_item = wp_setup_nav_menu_item($cat_item, 'category', $intCounter);
</del><ins>+                        $cat_item = wp_setup_nav_menu_item($cat_item, 'category', $items_counter);
</ins><span class="cx">                         // Custom Menu
</span><span class="cx">                         if ( $type == 'menu' ) {
</span><span class="cx">                                 ?&gt;
</span><span class="cx"> 
</span><del>-                                &lt;li id=&quot;menu-&lt;?php echo $intCounter; ?&gt;&quot; value=&quot;&lt;?php echo $intCounter; ?&gt;&quot;&gt;
</del><ins>+                                &lt;li id=&quot;menu-&lt;?php echo $items_counter; ?&gt;&quot; value=&quot;&lt;?php echo $items_counter; ?&gt;&quot;&gt;
</ins><span class="cx">                                         &lt;?php
</span><span class="cx">                                                 wp_print_nav_menu_item($cat_item, 'menu');
</span><span class="cx">                                                 $parentli = $cat_item-&gt;cat_ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_nav_menu_sub_items($cat_item-&gt;cat_ID, $intCounter, $parentli, 'categories', 'menu');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_nav_menu_sub_items($cat_item-&gt;cat_ID, $items_counter, $parentli, 'categories', 'menu');
</ins><span class="cx">                                         ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;/li&gt;
</span><span class="lines">@@ -126,8 +126,8 @@
</span><span class="cx">                                         &lt;?php
</span><span class="cx">                                                 wp_print_nav_menu_item($cat_item, 'default');
</span><span class="cx">                                                 $parentli = $cat_item-&gt;cat_ID;
</span><del>-                                                $intCounter++;
-                                                $intCounter = wp_nav_menu_sub_items($cat_item-&gt;cat_ID, $intCounter, $parentli, 'categories', 'default');
</del><ins>+                                                $items_counter++;
+                                                $items_counter = wp_nav_menu_sub_items($cat_item-&gt;cat_ID, $items_counter, $parentli, 'categories', 'default');
</ins><span class="cx">                                         ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;/li&gt;
</span><span class="lines">@@ -137,13 +137,13 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        return $intCounter;
</del><ins>+        return $items_counter;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> //RECURSIVE Sub Menu Items of default categories and pages
</span><del>-function wp_nav_menu_sub_items($childof, $intCounter, $parentli, $type, $output_type) {
</del><ins>+function wp_nav_menu_sub_items($childof, $items_counter, $parentli, $type, $output_type) {
</ins><span class="cx"> 
</span><del>-        $counter = $intCounter;
</del><ins>+        $counter = $items_counter;
</ins><span class="cx"> 
</span><span class="cx">         // Custom Menu
</span><span class="cx">         if ( $output_type == 'menu' ) {
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationdynamicfunctionsdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/js/custom-navigation-dynamic-functions.dev.js        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">              jQuery(this).find('dl &gt; dt &gt; span &gt; #remove' + j).attr('onClick', 'removeitem(' + i + ')');
</span><span class="cx">              jQuery(this).find('dl &gt; dt &gt; span &gt; #remove' + j).attr('id','remove' + i);
</span><span class="cx"> 
</span><del>-             jQuery('#licount').attr('value',i);
</del><ins>+             jQuery('#li-count').attr('value',i);
</ins><span class="cx"> 
</span><span class="cx">    });
</span><span class="cx"> 
</span><span class="lines">@@ -142,16 +142,16 @@
</span><span class="cx">         var inputdescription = '';
</span><span class="cx">         var inputicon = '';
</span><span class="cx"> 
</span><del>-        if (additemtype == 'Custom')
</del><ins>+        if (additemtype == navMenuL10n.custom)
</ins><span class="cx">         {
</span><del>-                inputvaluevarname = document.getElementById('custom_menu_item_name').value;
-                inputvaluevarurl = document.getElementById('custom_menu_item_url').value;
</del><ins>+                inputvaluevarname = document.getElementById('custom-menu-item-name').value;
+                inputvaluevarurl = document.getElementById('custom-menu-item-url').value;
</ins><span class="cx">                 inputitemid = '';
</span><span class="cx">                 inputparentid = '';
</span><span class="cx">                 inputlinktype = 'custom';
</span><del>-                inputdescription = document.getElementById('custom_menu_item_description').value;
</del><ins>+                inputdescription = '';
</ins><span class="cx">         }
</span><del>-        else if (additemtype == 'Page')
</del><ins>+        else if (additemtype == navMenuL10n.page)
</ins><span class="cx">         {
</span><span class="cx">                 inputvaluevarname = htmlentities(itemtext.toString());
</span><span class="cx">                 inputvaluevarurl = itemurl.toString();
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">                 inputdescription = htmlentities(itemdescription.toString());
</span><span class="cx"> 
</span><span class="cx">         }
</span><del>-        else if (additemtype == 'Category')
</del><ins>+        else if (additemtype == navMenuL10n.category)
</ins><span class="cx">         {
</span><span class="cx">                 inputvaluevarname = htmlentities(itemtext.toString());
</span><span class="cx">                 inputvaluevarurl = itemurl.toString();
</span></span></pre></div>
<a id="trunkwpadminjscustomnavigationdynamicfunctionsjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/custom-navigation-dynamic-functions.js (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-navigation-dynamic-functions.js        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/js/custom-navigation-dynamic-functions.js        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -1 +1 @@
</span><del>-function removeitem(o){var todelete=document.getElementById(&quot;menu-&quot;+o);if(todelete){var parenttodelete=document.getElementById(&quot;menu-&quot;+o).parentNode;throwaway_node=parenttodelete.removeChild(todelete)}updatepostdata()}function edititem(o){itemTitle=jQuery(&quot;#title&quot;+o).attr(&quot;value&quot;);itemURL=jQuery(&quot;#linkurl&quot;+o).attr(&quot;value&quot;);itemAnchorTitle=jQuery(&quot;#anchortitle&quot;+o).attr(&quot;value&quot;);itemNewWindow=jQuery(&quot;#newwindow&quot;+o).attr(&quot;value&quot;);itemDesc=jQuery(&quot;#description&quot;+o).attr(&quot;value&quot;);jQuery(&quot;#dialog-confirm&quot;).dialog(&quot;option&quot;,&quot;itemID&quot;,o);jQuery(&quot;#dialog-confirm&quot;).dialog(&quot;open&quot;);jQuery(&quot;#edittitle&quot;).attr(&quot;value&quot;,itemTitle);jQuery(&quot;#editlink&quot;).attr(&quot;value&quot;,itemURL);jQuery(&quot;#editanchortitle&quot;).attr(&quot;value&quot;,itemAnchorTitle);jQuery(&quot;#editnewwindow option[value='&quot;+itemNewWindow+&quot;']&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);jQuery(&quot;#editdescription&quot;).attr(&quot;value&quot;,itemDesc)}function updatepostdata(){var i=0;jQuery(&quot;#custom-nav&quot;).find(&quot;li&quot;).each(function(i){i=i+1;var j=jQuery(this).attr(&quot;value&quot;);jQuery(this).find(&quot;#position&quot;+j).attr(&quot;value&quot;,i);jQuery(this).attr(&quot;id&quot;,&quot;menu-&quot;+i);jQuery(this).attr(&quot;value&quot;,i);jQuery(this).find(&quot;#dbid&quot;+j).attr(&quot;name&quot;,&quot;dbid&quot;+i);jQuery(this).find(&quot;#dbid&quot;+j).attr(&quot;id&quot;,&quot;dbid&quot;+i);jQuery(this).find(&quot;#postmenu&quot;+j).attr(&quot;name&quot;,&quot;postmenu&quot;+i);jQuery(this).find(&quot;#postmenu&quot;+j).attr(&quot;id&quot;,&quot;postmenu&quot;+i);var p=jQuery(this).find(&quot;#parent&quot;+j).parent().parent().parent().attr(&quot;value&quot;);jQuery(this).find(&quot;#parent&quot;+j).attr(&quot;name&quot;,&quot;parent&quot;+i);jQuery(this).find(&quot;#parent&quot;+j).attr(&quot;id&quot;,&quot;parent&quot;+i);if(p){}else{p=0}jQuery(this).find(&quot;#parent&quot;+j).attr(&quot;value&quot;,p);jQuery(this).find(&quot;#title&quot;+j).attr(&quot;name&quot;,&quot;title&quot;+i);jQuery(this).find(&quot;#title&quot;+j).attr(&quot;id&quot;,&quot;title&quot;+i);jQuery(this).find(&quot;#linkurl&quot;+j).attr(&quot;name&quot;,&quot;linkurl&quot;+i);jQuery(this).find(&quot;#linkurl&quot;+j).attr(&quot;id&quot;,&quot;linkurl&quot;+i);jQuery(this).find(&quot;#description&quot;+j).attr(&quot;name&quot;,&quot;description&quot;+i);jQuery(this).find(&quot;#description&quot;+j).attr(&quot;id&quot;,&quot;description&quot;+i);jQuery(this).find(&quot;#icon&quot;+j).attr(&quot;name&quot;,&quot;icon&quot;+i);jQuery(this).find(&quot;#icon&quot;+j).attr(&quot;id&quot;,&quot;icon&quot;+i);jQuery(this).find(&quot;#position&quot;+j).attr(&quot;name&quot;,&quot;position&quot;+i);jQuery(this).find(&quot;#position&quot;+j).attr(&quot;id&quot;,&quot;position&quot;+i);jQuery(this).find(&quot;#linktype&quot;+j).attr(&quot;name&quot;,&quot;linktype&quot;+i);jQuery(this).find(&quot;#linktype&quot;+j).attr(&quot;id&quot;,&quot;linktype&quot;+i);jQuery(this).find(&quot;#anchortitle&quot;+j).attr(&quot;name&quot;,&quot;anchortitle&quot;+i);jQuery(this).find(&quot;#anchortitle&quot;+j).attr(&quot;id&quot;,&quot;anchortitle&quot;+i);jQuery(this).find(&quot;#newwindow&quot;+j).attr(&quot;name&quot;,&quot;newwindow&quot;+i);jQuery(this).find(&quot;#newwindow&quot;+j).attr(&quot;id&quot;,&quot;newwindow&quot;+i);jQuery(this).find(&quot;dl &gt; dt &gt; span &gt; #remove&quot;+j).attr(&quot;value&quot;,i);jQuery(this).find(&quot;dl &gt; dt &gt; span &gt; #remove&quot;+j).attr(&quot;onClick&quot;,&quot;removeitem(&quot;+i+&quot;)&quot;);jQuery(this).find(&quot;dl &gt; dt &gt; span &gt; #remove&quot;+j).attr(&quot;id&quot;,&quot;remove&quot;+i);jQuery(&quot;#licount&quot;).attr(&quot;value&quot;,i)})}function appendToList(templatedir,additemtype,itemtext,itemurl,itemid,itemparentid,itemdescription){var inputvaluevarname=&quot;&quot;;var inputvaluevarurl=&quot;&quot;;var inputitemid=&quot;&quot;;var inputparentid=&quot;&quot;;var inputdescription=&quot;&quot;;var inputicon=&quot;&quot;;if(additemtype==&quot;Custom&quot;){inputvaluevarname=document.getElementById(&quot;custom_menu_item_name&quot;).value;inputvaluevarurl=document.getElementById(&quot;custom_menu_item_url&quot;).value;inputitemid=&quot;&quot;;inputparentid=&quot;&quot;;inputlinktype=&quot;custom&quot;;inputdescription=document.getElementById(&quot;custom_menu_item_description&quot;).value}else{if(additemtype==&quot;Page&quot;){inputvaluevarname=htmlentities(itemtext.toString());inputvaluevarurl=itemurl.toString();inputitemid=itemid.toString();inputparentid=&quot;0&quot;;inputlinktype=&quot;page&quot;;inputdescription=htmlentities(itemdescription.toString())}else{if(additemtype==&quot;Category&quot;){inputvaluevarname=htmlentities(itemtext.toString());inputvaluevarurl=itemurl.toString();inputitemid=itemid.toString();inputparentid=&quot;0&quot;;inputlinktype=&quot;category&quot;;inputdescription=htmlentities(itemdescription.toString())}else{inputvaluevarname=&quot;&quot;;inputvaluevarname=&quot;&quot;;inputitemid=&quot;&quot;;inputparentid=&quot;&quot;;inputlinktype=&quot;custom&quot;;inputdescription=&quot;&quot;}}}var count=document.getElementById(&quot;custom-nav&quot;).getElementsByTagName(&quot;li&quot;).length+1;var randomnumber=count;var validatetest=0;try{var test=document.getElementById(&quot;menu-&quot;+randomnumber.toString()).value}catch(err){validatetest=1}while(validatetest==0){randomnumber=randomnumber+1;try{var test2=document.getElementById(&quot;menu-&quot;+randomnumber.toString()).value}catch(err){validatetest=1}}jQuery(&quot;.maintitle&quot;).after('&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;Menu Item added!&lt;/p&gt;&lt;/div&gt;');jQuery(&quot;#message&quot;).animate({opacity:1},2000).fadeOut(300,function(){jQuery(this).remove()});jQuery(&quot;#custom-nav&quot;).append('&lt;li id=&quot;menu-'+randomnumber+'&quot; value=&quot;'+randomnumber+'&quot;&gt;&lt;div class=&quot;dropzone ui-droppable&quot;&gt;&lt;/div&gt;&lt;dl class=&quot;ui-droppable&quot;&gt;&lt;dt&gt;&lt;span class=&quot;title&quot;&gt;'+inputvaluevarname+'&lt;/span&gt;&lt;span class=&quot;controls&quot;&gt;&lt;span class=&quot;type&quot;&gt;'+additemtype+'&lt;/span&gt;&lt;a id=&quot;edit'+randomnumber+'&quot; onclick=&quot;edititem('+randomnumber+')&quot; value=&quot;'+randomnumber+'&quot;&gt;&lt;img class=&quot;edit&quot; alt=&quot;Edit Menu Item&quot; title=&quot;Edit Menu Item&quot; src=&quot;'+templatedir+'/wp-admin/images/ico-edit.png&quot; /&gt;&lt;/a&gt; &lt;a id=&quot;remove'+randomnumber+'&quot; onclick=&quot;removeitem('+randomnumber+')&quot; value=&quot;'+randomnumber+'&quot;&gt;&lt;img class=&quot;remove&quot; alt=&quot;Remove from Custom Menu&quot; title=&quot;Remove from Custom Menu&quot; src=&quot;'+templatedir+'/wp-admin/images/ico-close.png&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;'+inputvaluevarurl+'&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;View Custom Link&quot; title=&quot;View Custom Link&quot; src=&quot;'+templatedir+'/wp-admin/images/ico-viewpage.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;a class=&quot;hide&quot; href=&quot;'+inputvaluevarurl+'&quot;&gt;'+inputvaluevarname+'&lt;/a&gt;&lt;input type=&quot;hidden&quot; name=&quot;postmenu'+randomnumber+'&quot; id=&quot;postmenu'+randomnumber+'&quot; value=&quot;'+inputitemid+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;parent'+randomnumber+'&quot; id=&quot;parent'+randomnumber+'&quot; value=&quot;'+inputparentid+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;title'+randomnumber+'&quot; id=&quot;title'+randomnumber+'&quot; value=&quot;'+inputvaluevarname+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;linkurl'+randomnumber+'&quot; id=&quot;linkurl'+randomnumber+'&quot; value=&quot;'+inputvaluevarurl+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;description'+randomnumber+'&quot; id=&quot;description'+randomnumber+'&quot; value=&quot;'+inputdescription+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;icon'+randomnumber+'&quot; id=&quot;icon'+randomnumber+'&quot; value=&quot;'+inputicon+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;position'+randomnumber+'&quot; id=&quot;position'+randomnumber+'&quot; value=&quot;'+randomnumber+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;linktype'+randomnumber+'&quot; id=&quot;linktype'+randomnumber+'&quot; value=&quot;'+inputlinktype+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;anchortitle'+randomnumber+'&quot; id=&quot;anchortitle'+randomnumber+'&quot; value=&quot;'+inputvaluevarname+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;newwindow'+randomnumber+'&quot; id=&quot;newwindow'+randomnumber+'&quot; value=&quot;0&quot; /&gt;&lt;/li&gt;');jQuery(&quot;#menu-&quot;+randomnumber+&quot;&quot;).draggable({handle:&quot; &gt; dl&quot;,opacity:0.8,addClasses:false,helper:&quot;clone&quot;,zIndex:100});jQuery(&quot;#menu-&quot;+randomnumber+&quot; dl, #menu-&quot;+randomnumber+&quot; .dropzone&quot;).droppable({accept:&quot;#&quot;+randomnumber+&quot;, #custom-nav li&quot;,tolerance:&quot;pointer&quot;,drop:function(e,ui){var li=jQuery(this).parent();var child=!jQuery(this).hasClass(&quot;dropzone&quot;);if(child&amp;&amp;li.children(&quot;ul&quot;).length==0){li.append(&quot;&lt;ul/&gt;&quot;)}if(child){li.children(&quot;ul&quot;).append(ui.draggable)}else{li.before(ui.draggable)}li.find(&quot;dl,.dropzone&quot;).css({backgroundColor:&quot;&quot;,borderColor:&quot;&quot;});var draggablevalue=ui.draggable.attr(&quot;value&quot;);var droppablevalue=li.attr(&quot;value&quot;);li.find(&quot;#menu-&quot;+draggablevalue).find(&quot;#parent&quot;+draggablevalue).val(droppablevalue);jQuery(this).parent().find(&quot;dt&quot;).removeAttr(&quot;style&quot;);jQuery(this).parent().find(&quot;div:first&quot;).removeAttr(&quot;style&quot;)},over:function(){if(jQuery(this).attr(&quot;class&quot;)==&quot;dropzone ui-droppable&quot;){jQuery(this).parent().find(&quot;div:first&quot;).css(&quot;background&quot;,&quot;none&quot;).css(&quot;height&quot;,&quot;50px&quot;)}else{if(jQuery(this).attr(&quot;class&quot;)==&quot;ui-droppable&quot;){jQuery(this).parent().find(&quot;dt:first&quot;).css(&quot;background&quot;,&quot;#d8d8d8&quot;)}else{}}var parentid=jQuery(this).parent().attr(&quot;id&quot;)},out:function(){jQuery(this).parent().find(&quot;dt&quot;).removeAttr(&quot;style&quot;);jQuery(this).parent().find(&quot;div:first&quot;).removeAttr(&quot;style&quot;);jQuery(this).filter(&quot;.dropzone&quot;).css({borderColor:&quot;&quot;})}});updatepostdata()};
</del><span class="cx">\ No newline at end of file
</span><ins>+function removeitem(c){var b=document.getElementById(&quot;menu-&quot;+c);if(b){var a=document.getElementById(&quot;menu-&quot;+c).parentNode;throwaway_node=a.removeChild(b)}updatepostdata()}function edititem(a){itemTitle=jQuery(&quot;#title&quot;+a).attr(&quot;value&quot;);itemURL=jQuery(&quot;#linkurl&quot;+a).attr(&quot;value&quot;);itemAnchorTitle=jQuery(&quot;#anchortitle&quot;+a).attr(&quot;value&quot;);itemNewWindow=jQuery(&quot;#newwindow&quot;+a).attr(&quot;value&quot;);itemDesc=jQuery(&quot;#description&quot;+a).attr(&quot;value&quot;);jQuery(&quot;#dialog-confirm&quot;).dialog(&quot;option&quot;,&quot;itemID&quot;,a);jQuery(&quot;#dialog-confirm&quot;).dialog(&quot;open&quot;);jQuery(&quot;#edittitle&quot;).attr(&quot;value&quot;,itemTitle);jQuery(&quot;#editlink&quot;).attr(&quot;value&quot;,itemURL);jQuery(&quot;#editanchortitle&quot;).attr(&quot;value&quot;,itemAnchorTitle);jQuery(&quot;#editnewwindow option[value='&quot;+itemNewWindow+&quot;']&quot;).attr(&quot;selected&quot;,&quot;selected&quot;);jQuery(&quot;#editdescription&quot;).attr(&quot;value&quot;,itemDesc)}function updatepostdata(){var a=0;jQuery(&quot;#custom-nav&quot;).find(&quot;li&quot;).each(function(c){c=c+1;var b=jQuery(this).attr(&quot;value&quot;);jQuery(this).find(&quot;#position&quot;+b).attr(&quot;value&quot;,c);jQuery(this).attr(&quot;id&quot;,&quot;menu-&quot;+c);jQuery(this).attr(&quot;value&quot;,c);jQuery(this).find(&quot;#dbid&quot;+b).attr(&quot;name&quot;,&quot;dbid&quot;+c);jQuery(this).find(&quot;#dbid&quot;+b).attr(&quot;id&quot;,&quot;dbid&quot;+c);jQuery(this).find(&quot;#postmenu&quot;+b).attr(&quot;name&quot;,&quot;postmenu&quot;+c);jQuery(this).find(&quot;#postmenu&quot;+b).attr(&quot;id&quot;,&quot;postmenu&quot;+c);var d=jQuery(this).find(&quot;#parent&quot;+b).parent().parent().parent().attr(&quot;value&quot;);jQuery(this).find(&quot;#parent&quot;+b).attr(&quot;name&quot;,&quot;parent&quot;+c);jQuery(this).find(&quot;#parent&quot;+b).attr(&quot;id&quot;,&quot;parent&quot;+c);if(d){}else{d=0}jQuery(this).find(&quot;#parent&quot;+b).attr(&quot;value&quot;,d);jQuery(this).find(&quot;#title&quot;+b).attr(&quot;name&quot;,&quot;title&quot;+c);jQuery(this).find(&quot;#title&quot;+b).attr(&quot;id&quot;,&quot;title&quot;+c);jQuery(this).find(&quot;#linkurl&quot;+b).attr(&quot;name&quot;,&quot;linkurl&quot;+c);jQuery(this).find(&quot;#linkurl&quot;+b).attr(&quot;id&quot;,&quot;linkurl&quot;+c);jQuery(this).find(&quot;#description&quot;+b).attr(&quot;name&quot;,&quot;description&quot;+c);jQuery(this).find(&quot;#description&quot;+b).attr(&quot;id&quot;,&quot;description&quot;+c);jQuery(this).find(&quot;#icon&quot;+b).attr(&quot;name&quot;,&quot;icon&quot;+c);jQuery(this).find(&quot;#icon&quot;+b).attr(&quot;id&quot;,&quot;icon&quot;+c);jQuery(this).find(&quot;#position&quot;+b).attr(&quot;name&quot;,&quot;position&quot;+c);jQuery(this).find(&quot;#position&quot;+b).attr(&quot;id&quot;,&quot;position&quot;+c);jQuery(this).find(&quot;#linktype&quot;+b).attr(&quot;name&quot;,&quot;linktype&quot;+c);jQuery(this).find(&quot;#linktype&quot;+b).attr(&quot;id&quot;,&quot;linktype&quot;+c);jQuery(this).find(&quot;#anchortitle&quot;+b).attr(&quot;name&quot;,&quot;anchortitle&quot;+c);jQuery(this).find(&quot;#anchortitle&quot;+b).attr(&quot;id&quot;,&quot;anchortitle&quot;+c);jQuery(this).find(&quot;#newwindow&quot;+b).attr(&quot;name&quot;,&quot;newwindow&quot;+c);jQuery(this).find(&quot;#newwindow&quot;+b).attr(&quot;id&quot;,&quot;newwindow&quot;+c);jQuery(this).find(&quot;dl &gt; dt &gt; span &gt; #remove&quot;+b).attr(&quot;value&quot;,c);jQuery(this).find(&quot;dl &gt; dt &gt; span &gt; #remove&quot;+b).attr(&quot;onClick&quot;,&quot;removeitem(&quot;+c+&quot;)&quot;);jQuery(this).find(&quot;dl &gt; dt &gt; span &gt; #remove&quot;+b).attr(&quot;id&quot;,&quot;remove&quot;+c);jQuery(&quot;#li-count&quot;).attr(&quot;value&quot;,c)})}function appendToList(b,s,d,n,h,l,e){var k=&quot;&quot;;var c=&quot;&quot;;var r=&quot;&quot;;var o=&quot;&quot;;var i=&quot;&quot;;var a=&quot;&quot;;if(s==navMenuL10n.custom){k=document.getElementById(&quot;custom-menu-item-name&quot;).value;c=document.getElementById(&quot;custom-menu-item-url&quot;).value;r=&quot;&quot;;o=&quot;&quot;;inputlinktype=&quot;custom&quot;;i=&quot;&quot;}else{if(s==navMenuL10n.page){k=htmlentities(d.toString());c=n.toString();r=h.toString();o=&quot;0&quot;;inputlinktype=&quot;page&quot;;i=htmlentities(e.toString())}else{if(s==navMenuL10n.category){k=htmlentities(d.toString());c=n.toString();r=h.toString();o=&quot;0&quot;;inputlinktype=&quot;category&quot;;i=htmlentities(e.toString())}else{k=&quot;&quot;;k=&quot;&quot;;r=&quot;&quot;;o=&quot;&quot;;inputlinktype=&quot;custom&quot;;i=&quot;&quot;}}}var g=document.getElementById(&quot;custom-nav&quot;).getElementsByTagName(&quot;li&quot;).length+1;var p=g;var m=0;try{var q=document.getElementById(&quot;menu-&quot;+p.toString()).value}catch(f){m=1}while(m==0){p=p+1;try{var j=document.getElementById(&quot;menu-&quot;+p.toString()).value}catch(f){m=1}}jQuery(&quot;.maintitle&quot;).after('&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;Menu Item added!&lt;/p&gt;&lt;/div&gt;');jQuery(&quot;#message&quot;).animate({opacity:1},2000).fadeOut(300,function(){jQuery(this).remove()});jQuery(&quot;#custom-nav&quot;).append('&lt;li id=&quot;menu-'+p+'&quot; value=&quot;'+p+'&quot;&gt;&lt;div class=&quot;dropzone ui-droppable&quot;&gt;&lt;/div&gt;&lt;dl class=&quot;ui-droppable&quot;&gt;&lt;dt&gt;&lt;span class=&quot;title&quot;&gt;'+k+'&lt;/span&gt;&lt;span class=&quot;controls&quot;&gt;&lt;span class=&quot;type&quot;&gt;'+s+'&lt;/span&gt;&lt;a id=&quot;edit'+p+'&quot; onclick=&quot;edititem('+p+')&quot; value=&quot;'+p+'&quot;&gt;&lt;img class=&quot;edit&quot; alt=&quot;Edit Menu Item&quot; title=&quot;Edit Menu Item&quot; src=&quot;'+b+'/wp-admin/images/ico-edit.png&quot; /&gt;&lt;/a&gt; &lt;a id=&quot;remove'+p+'&quot; onclick=&quot;removeitem('+p+')&quot; value=&quot;'+p+'&quot;&gt;&lt;img class=&quot;remove&quot; alt=&quot;Remove from Custom Menu&quot; title=&quot;Remove from Custom Menu&quot; src=&quot;'+b+'/wp-admin/images/ico-close.png&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;'+c+'&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;View Custom Link&quot; title=&quot;View Custom Link&quot; src=&quot;'+b+'/wp-admin/images/ico-viewpage.png&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;a class=&quot;hide&quot; href=&quot;'+c+'&quot;&gt;'+k+'&lt;/a&gt;&lt;input type=&quot;hidden&quot; name=&quot;postmenu'+p+'&quot; id=&quot;postmenu'+p+'&quot; value=&quot;'+r+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;parent'+p+'&quot; id=&quot;parent'+p+'&quot; value=&quot;'+o+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;title'+p+'&quot; id=&quot;title'+p+'&quot; value=&quot;'+k+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;linkurl'+p+'&quot; id=&quot;linkurl'+p+'&quot; value=&quot;'+c+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;description'+p+'&quot; id=&quot;description'+p+'&quot; value=&quot;'+i+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;icon'+p+'&quot; id=&quot;icon'+p+'&quot; value=&quot;'+a+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;position'+p+'&quot; id=&quot;position'+p+'&quot; value=&quot;'+p+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;linktype'+p+'&quot; id=&quot;linktype'+p+'&quot; value=&quot;'+inputlinktype+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;anchortitle'+p+'&quot; id=&quot;anchortitle'+p+'&quot; value=&quot;'+k+'&quot; /&gt;&lt;input type=&quot;hidden&quot; name=&quot;newwindow'+p+'&quot; id=&quot;newwindow'+p+'&quot; value=&quot;0&quot; /&gt;&lt;/li&gt;');jQuery(&quot;#menu-&quot;+p+&quot;&quot;).draggable({handle:&quot; &gt; dl&quot;,opacity:0.8,addClasses:false,helper:&quot;clone&quot;,zIndex:100});jQuery(&quot;#menu-&quot;+p+&quot; dl, #menu-&quot;+p+&quot; .dropzone&quot;).droppable({accept:&quot;#&quot;+p+&quot;, #custom-nav li&quot;,tolerance:&quot;pointer&quot;,drop:function(x,w){var t=jQuery(this).parent();var y=!jQuery(this).hasClass(&quot;dropzone&quot;);if(y&amp;&amp;t.children(&quot;ul&quot;).length==0){t.append(&quot;&lt;ul/&gt;&quot;)}if(y){t.children(&quot;ul&quot;).append(w.draggable)}else{t.before(w.draggable)}t.find(&quot;dl,.dropzone&quot;).css({backgroundColor:&quot;&quot;,borderColor:&quot;&quot;});var v=w.draggable.attr(&quot;value&quot;);var u=t.attr(&quot;value&quot;);t.find(&quot;#menu-&quot;+v).find(&quot;#parent&quot;+v).val(u);jQuery(this).parent().find(&quot;dt&quot;).removeAttr(&quot;style&quot;);jQuery(this).parent().find(&quot;div:first&quot;).removeAttr(&quot;style&quot;)},over:function(){if(jQuery(this).attr(&quot;class&quot;)==&quot;dropzone ui-droppable&quot;){jQuery(this).parent().find(&quot;div:first&quot;).css(&quot;background&quot;,&quot;none&quot;).css(&quot;height&quot;,&quot;50px&quot;)}else{if(jQuery(this).attr(&quot;class&quot;)==&quot;ui-droppable&quot;){jQuery(this).parent().find(&quot;dt:first&quot;).css(&quot;background&quot;,&quot;#d8d8d8&quot;)}else{}}var t=jQuery(this).parent().attr(&quot;id&quot;)},out:function(){jQuery(this).parent().find(&quot;dt&quot;).removeAttr(&quot;style&quot;);jQuery(this).parent().find(&quot;div:first&quot;).removeAttr(&quot;style&quot;);jQuery(this).filter(&quot;.dropzone&quot;).css({borderColor:&quot;&quot;})}});updatepostdata()};
</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 (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-admin/nav-menus.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -31,25 +31,25 @@
</span><span class="cx"> 
</span><span class="cx"> function wp_reset_nav_menu() {
</span><span class="cx">         wp_nav_menu_setup(true);
</span><del>-
</del><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-$messagesdiv = '';
</del><ins>+$messages_div = '';
</ins><span class="cx"> $menu_id_in_edit = 0;
</span><span class="cx"> $updated = false;
</span><ins>+$advanced_option_descriptions = 'no';
</ins><span class="cx"> 
</span><span class="cx"> // Check which menu is selected and if menu is in edit already
</span><del>-if ( isset( $_GET['edit_menu'] ) ) {
-        $menu_selected_id = (int) $_GET['edit_menu'];
</del><ins>+if ( isset( $_GET['edit-menu'] ) ) {
+        $menu_selected_id = (int) $_GET['edit-menu'];
</ins><span class="cx">         $updated = true;
</span><del>-} elseif ( isset( $_POST[ 'menu_id_in_edit' ] ) ) {
-        $menu_selected_id = (int) $_POST[ 'menu_id_in_edit' ];
</del><ins>+} elseif ( isset( $_POST[ 'menu-id-in-edit' ] ) ) {
+        $menu_selected_id = (int) $_POST[ 'menu-id-in-edit' ];
</ins><span class="cx"> } else {
</span><span class="cx">         $menu_selected_id = 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( isset( $_POST[ 'delete_menu' ] ) &amp;&amp; $menu_selected_id &gt; 0 ) {
</del><ins>+if ( isset( $_POST[ 'delete-menu' ] ) &amp;&amp; $menu_selected_id &gt; 0 ) {
</ins><span class="cx">         wp_delete_nav_menu( $menu_selected_id );
</span><span class="cx">         $menu_selected_id = 0;
</span><span class="cx">         $updated = true;
</span><span class="lines">@@ -70,52 +70,51 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( isset( $_POST['licount'] ) )
-        $postCounter = $_POST['licount'];
</del><ins>+if ( isset( $_POST['li-count'] ) )
+        $post_counter = $_POST['li-count'];
</ins><span class="cx"> else
</span><del>-        $postCounter = 0;
</del><ins>+        $post_counter = 0;
</ins><span class="cx"> 
</span><span class="cx"> // Create a new menu. Menus are stored as terms in the 'menu' taxonomy.
</span><del>-if ( isset( $_POST['add_menu'] ) &amp;&amp; ! $updated ) {
-        update_option( 'wp_custom_nav_menu', $_POST['enable_wp_menu'] ); // Do we need this?
-        $insert_menu_name = $_POST['add_menu_name'];
</del><ins>+if ( isset( $_POST['add-menu'] ) &amp;&amp; ! $updated ) {
+        $insert_menu_name = $_POST['add-menu-name'];
</ins><span class="cx"> 
</span><del>-        if ( $insert_menu_name != '' ) {
-                $menu = wp_create_nav_menu($insert_menu_name);
-                if ( is_wp_error($menu) ) {
-                        $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;error fade below-h2&quot;&gt;&lt;p&gt;' . esc_html( $menu-&gt;get_error_message() ) . '&lt;/p&gt;&lt;/div&gt;';
</del><ins>+        if ( $insert_menu_name ) {
+                $menu = wp_create_nav_menu( $insert_menu_name );
+                if ( is_wp_error( $menu ) ) {
+                        $messages_div = '&lt;div id=&quot;message&quot; class=&quot;error fade below-h2&quot;&gt;&lt;p&gt;' . $menu-&gt;get_error_message() . '&lt;/p&gt;&lt;/div&gt;';
</ins><span class="cx">                 } else {
</span><span class="cx">                         $custom_menus[$menu-&gt;term_id] = $menu;
</span><span class="cx">                         $menu_selected_id = $menu-&gt;term_id;
</span><span class="cx">                         $menu_id_in_edit = $menu_selected_id;
</span><span class="cx">                         $menu_title = $menu-&gt;name;
</span><del>-                        $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;' . esc_html( sprintf( __('&quot;%s&quot; menu has been created!'), $menu-&gt;name ) ) . '&lt;/p&gt;&lt;/div&gt;';
-                        $postCounter = 0;
</del><ins>+                        $messages_div = '&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;' . sprintf( __('&amp;#8220;%s&amp;#8221; menu has been created.'), esc_html( $menu-&gt;name ) ) . '&lt;/p&gt;&lt;/div&gt;';
+                        $post_counter = 0;
</ins><span class="cx">                 }
</span><span class="cx">         } else {
</span><del>-                $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;error fade below-h2&quot;&gt;&lt;p&gt;' . __('Please enter a valid menu name.') . '&lt;/p&gt;&lt;/div&gt;';
</del><ins>+                $messages_div = '&lt;div id=&quot;message&quot; class=&quot;error fade below-h2&quot;&gt;&lt;p&gt;' . __('Please enter a valid menu name.') . '&lt;/p&gt;&lt;/div&gt;';
</ins><span class="cx">         }
</span><span class="cx">         $updated = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if ( $postCounter &gt; 0 &amp;&amp; $menu_selected_id &gt; 0 &amp;&amp; ! $updated ) {
</del><ins>+if ( $post_counter &gt; 0 &amp;&amp; $menu_selected_id &gt; 0 &amp;&amp; ! $updated ) {
</ins><span class="cx">         $menu_items = wp_get_nav_menu_items( $menu_selected_id, array('orderby' =&gt; 'ID', 'output' =&gt; ARRAY_A, 'output_key' =&gt; 'ID') );
</span><span class="cx">         $parent_menu_ids = array();
</span><span class="cx"> 
</span><span class="cx">         // Loop through all POST variables
</span><del>-        for ( $k = 1; $k &lt;= $postCounter; $k++ ) {
-                if (isset($_POST['dbid'.$k])) { $db_id = $_POST['dbid'.$k]; } else { $db_id = 0; }
-                if (isset($_POST['postmenu'.$k])) { $object_id = $_POST['postmenu'.$k]; } else { $object_id = 0; }
-                if (isset($_POST['parent'.$k])) { $parent_id = $_POST['parent'.$k]; } else { $parent_id = 0; }
-                if (isset($_POST['title'.$k])) { $custom_title = $_POST['title'.$k]; } else { $custom_title = ''; }
-                if (isset($_POST['linkurl'.$k])) { $custom_linkurl = $_POST['linkurl'.$k]; } else { $custom_linkurl = ''; }
-                if (isset($_POST['description'.$k])) { $custom_description = $_POST['description'.$k]; } else { $custom_description = ''; }
</del><ins>+        for ( $k = 1; $k &lt;= $post_counter; $k++ ) {
+                $db_id = isset( $_POST['dbid'.$k] )? $_POST['dbid'.$k] : 0;
+                $object_id = isset( $_POST['postmenu'.$k] )? $_POST['postmenu'.$k] : 0;
+                $parent_id = isset( $_POST['parent'.$k] )? $_POST['parent'.$k] : 0;
+                $custom_title = isset( $_POST['title'.$k] )?  $_POST['title'.$k] : '';
+                $custom_linkurl = isset( $_POST['linkurl'.$k] )? $_POST['linkurl'.$k] : '';
+                $custom_description = isset( $_POST['description'.$k] )? $_POST['description'.$k] : '';
</ins><span class="cx">                 // doesn't seem to be used by UI
</span><del>-                if (isset($_POST['icon'.$k])) { $icon = $_POST['icon'.$k]; } else { $icon = 0; }
-                if (isset($_POST['position'.$k])) { $position = $_POST['position'.$k]; } else { $position = 0; }
-                if (isset($_POST['linktype'.$k])) { $linktype = $_POST['linktype'.$k]; } else { $linktype = 'custom'; }
-                if (isset($_POST['anchortitle'.$k])) { $custom_anchor_title = $_POST['anchortitle'.$k]; } else { $custom_anchor_title = $custom_title; }
-                if (isset($_POST['newwindow'.$k])) { $new_window = $_POST['newwindow'.$k]; } else { $new_window = 0; }
</del><ins>+                $icon = isset( $_POST['icon'.$k] )? $_POST['icon'.$k] : 0;
+                $position = isset( $_POST['position'.$k] )? $_POST['position'.$k] : 0;
+                $linktype = isset( $_POST['linktype'.$k] )? $_POST['linktype'.$k] : 'custom';
+                $custom_anchor_title  = isset( $_POST['anchortitle'.$k] )? $_POST['anchortitle'.$k] : $custom_title;
+                $new_window = isset( $_POST['newwindow'.$k] )? $_POST['newwindow'.$k] : 0;
</ins><span class="cx"> 
</span><span class="cx">                 $post = array( 'post_status' =&gt; 'publish', 'post_type' =&gt; 'nav_menu_item', 'post_author' =&gt; $user_ID,
</span><span class="cx">                         'ping_status' =&gt; 0, 'post_parent' =&gt; 0, 'menu_order' =&gt; $position,
</span><span class="lines">@@ -125,8 +124,8 @@
</span><span class="cx">                         $post['post_content_filtered'] = '_blank';
</span><span class="cx">                 else
</span><span class="cx">                         $post['post_content_filtered'] = '';
</span><del>-                if ( $parent_id &gt; 0 &amp;&amp; isset( $parent_menu_ids[ $parent_id ] ) )
-                        $post[ 'post_parent' ] = $parent_menu_ids[ $parent_id ];
</del><ins>+                if ( $parent_id &gt; 0 &amp;&amp; isset( $parent_menu_ids[$parent_id] ) )
+                        $post['post_parent'] = $parent_menu_ids[$parent_id];
</ins><span class="cx"> 
</span><span class="cx">                 // New menu item
</span><span class="cx">                 if ( $db_id == 0 ) {
</span><span class="lines">@@ -138,16 +137,15 @@
</span><span class="cx">                 }
</span><span class="cx">                 $parent_menu_ids[ $k ] = $db_id;
</span><span class="cx"> 
</span><del>-                update_post_meta($db_id, 'menu_type', $linktype);
-                update_post_meta($db_id, 'object_id', $object_id);
</del><ins>+                update_post_meta( $db_id, 'menu_type', $linktype );
+                update_post_meta( $db_id, 'object_id', $object_id );
</ins><span class="cx">         }
</span><span class="cx">         if ( !empty( $menu_items ) ) {
</span><span class="cx">                 foreach ( array_keys( $menu_items ) as $menu_id ) {
</span><span class="cx">                         wp_delete_post( $menu_id );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        // DISPLAY SUCCESS MESSAGE IF POST CORRECT
-        $messagesdiv = '&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;' . __('The menu has been updated.') . '&lt;/p&gt;&lt;/div&gt;';
</del><ins>+        $messages_div = '&lt;div id=&quot;message&quot; class=&quot;updated fade below-h2&quot;&gt;&lt;p&gt;' . __('The menu has been updated.') . '&lt;/p&gt;&lt;/div&gt;';
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ?&gt;
</span><span class="lines">@@ -155,51 +153,48 @@
</span><span class="cx"> &lt;?php screen_icon(); ?&gt;
</span><span class="cx"> &lt;h2&gt;&lt;?php esc_html_e('Menus') ?&gt;&lt;/h2&gt;
</span><span class="cx">         &lt;form onsubmit=&quot;updatepostdata()&quot; action=&quot;&lt;?php echo admin_url( 'nav-menus.php' ); ?&gt;&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
</span><del>-        &lt;?php if ( ! empty( $custom_menus ) &amp;&amp; count( $custom_menus ) &gt; 1 ) { ?&gt;
</del><ins>+&lt;?php if ( ! empty( $custom_menus ) &amp;&amp; count( $custom_menus ) &gt; 1 ): ?&gt;
</ins><span class="cx">                 &lt;ul class=&quot;subsubsub&quot;&gt;
</span><span class="cx"> &lt;?php
</span><span class="cx">                                 foreach ( $custom_menus as $menu ) {
</span><del>-                                        $sep = end($custom_menus) == $menu ? '' : ' | ';
-                                        // $menu_term = get_term( $menu, 'nav_menu' );
</del><ins>+                                        $sep = end( $custom_menus ) == $menu ? '' : ' | ';
</ins><span class="cx">                                         if ( ( $menu_id_in_edit == $menu-&gt;term_id ) || ( $menu_selected_id == $menu-&gt;term_id ) ) { ?&gt;
</span><del>-                                                &lt;li&gt;&lt;a href='nav-menus.php?edit_menu=&lt;?php echo esc_attr($menu-&gt;term_id); ?&gt;' class=&quot;current&quot;&gt;&lt;?php echo esc_html( $menu-&gt;name ); ?&gt;&lt;/a&gt;&lt;?php echo $sep; ?&gt;&lt;/li&gt;
</del><ins>+                                                &lt;li&gt;&lt;a href='nav-menus.php?edit-menu=&lt;?php echo esc_attr($menu-&gt;term_id); ?&gt;' class=&quot;current&quot;&gt;&lt;?php echo esc_html( $menu-&gt;name ); ?&gt;&lt;/a&gt;&lt;?php echo $sep; ?&gt;&lt;/li&gt;
</ins><span class="cx"> &lt;?php                                } else { ?&gt;
</span><del>-                                                &lt;li&gt;&lt;a href='nav-menus.php?edit_menu=&lt;?php echo esc_attr($menu-&gt;term_id); ?&gt;'&gt;&lt;?php echo esc_html( $menu-&gt;name ); ?&gt;&lt;/a&gt;&lt;?php echo $sep; ?&gt;&lt;/li&gt;
</del><ins>+                                                &lt;li&gt;&lt;a href='nav-menus.php?edit-menu=&lt;?php echo esc_attr($menu-&gt;term_id); ?&gt;'&gt;&lt;?php echo esc_html( $menu-&gt;name ); ?&gt;&lt;/a&gt;&lt;?php echo $sep; ?&gt;&lt;/li&gt;
</ins><span class="cx"> &lt;?php                                }
</span><span class="cx">                                 }
</span><span class="cx"> ?&gt;
</span><span class="cx">                 &lt;/ul&gt;
</span><span class="cx">                 &lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</span><del>-&lt;?php } ?&gt;
</del><ins>+&lt;?php endif ?&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;div class=&quot;hide-if-js error&quot;&gt;&lt;p&gt;&lt;?php _e('You do not have JavaScript enabled in your browser. Please enable it to access the Menus functionality.'); ?&gt;&lt;/p&gt;&lt;/div&gt;
</span><span class="cx">         &lt;div class=&quot;hide-if-no-js&quot;&gt;
</span><span class="cx">         &lt;div id=&quot;pages-left&quot;&gt;
</span><span class="cx">                 &lt;div class=&quot;inside&quot;&gt;
</span><span class="cx">                 &lt;?php if ( ! empty( $custom_menus ) ) : ?&gt;
</span><del>-                &lt;?php echo $messagesdiv; ?&gt;
</del><ins>+                &lt;?php echo $messages_div; ?&gt;
</ins><span class="cx"> 
</span><del>-                &lt;input type=&quot;hidden&quot; name=&quot;licount&quot; id=&quot;licount&quot; value=&quot;0&quot; /&gt;
-                &lt;input type=&quot;hidden&quot; name=&quot;menu_id_in_edit&quot; id=&quot;menu_id_in_edit&quot; value=&quot;&lt;?php echo esc_attr($menu_selected_id); ?&gt;&quot; /&gt;
</del><ins>+                &lt;input type=&quot;hidden&quot; name=&quot;li-count&quot; id=&quot;li-count&quot; value=&quot;0&quot; /&gt;
+                &lt;input type=&quot;hidden&quot; name=&quot;menu-id-in-edit&quot; id=&quot;menu-id-in-edit&quot; value=&quot;&lt;?php echo esc_attr( $menu_selected_id ); ?&gt;&quot; /&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;div class=&quot;sidebar-name&quot;&gt;
</span><span class="cx">                         &lt;div class=&quot;sidebar-name-arrow&quot;&gt;
</span><span class="cx">                                 &lt;br/&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><del>-                        &lt;h3&gt;&lt;?php echo esc_html($menu_title); ?&gt;&lt;/h3&gt;
</del><ins>+                        &lt;h3&gt;&lt;?php echo esc_html( $menu_title ); ?&gt;&lt;/h3&gt;
</ins><span class="cx"> 
</span><span class="cx">                 &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;div id=&quot;nav-container&quot;&gt;
</span><span class="cx">                         &lt;ul id=&quot;custom-nav&quot;&gt;
</span><span class="cx"> 
</span><del>-                &lt;?php
-                //DISPLAY existing menu
</del><ins>+&lt;?php
</ins><span class="cx">                 if ( $menu_selected_id &gt; 0 ) {
</span><del>-                        wp_print_nav_menu( 'type=backend&amp;name='.$menu_title.'&amp;id='.$menu_selected_id );
</del><ins>+                        wp_print_nav_menu( array( 'type' =&gt; 'backend', 'name' =&gt; $menu_title, 'id' =&gt; $menu_selected_id ) );
</ins><span class="cx">                 }
</span><del>-                ?&gt;
-
</del><ins>+?&gt;
</ins><span class="cx">                         &lt;/ul&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- /#nav-container --&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -209,7 +204,7 @@
</span><span class="cx">                         updatepostdata();
</span><span class="cx">                 &lt;/script&gt;
</span><span class="cx">                 &lt;input id=&quot;save_bottom&quot; name=&quot;save_bottom&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Save All Changes'); ?&gt;&quot; /&gt;
</span><del>-                &lt;input id=&quot;delete_menu&quot; name=&quot;delete_menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Delete This Menu'); ?&gt;&quot; /&gt;
</del><ins>+                &lt;input id=&quot;delete-menu&quot; name=&quot;delete-menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Delete This Menu'); ?&gt;&quot; /&gt;
</ins><span class="cx">                 &lt;/p&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;?php else : ?&gt;
</span><span class="lines">@@ -227,128 +222,71 @@
</span><span class="cx">                         &lt;div class=&quot;widget-holder&quot;&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;span&gt;
</span><del>-                                &lt;input id=&quot;add_menu_name&quot; name=&quot;add_menu_name&quot; type=&quot;text&quot; value=&quot;&quot;  /&gt;
-                                &lt;input id=&quot;add_menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Add Menu'); ?&gt;&quot; name=&quot;add_menu&quot; class=&quot;button&quot; /&gt;
</del><ins>+                                &lt;input id=&quot;add-menu-name&quot; name=&quot;add-menu-name&quot; type=&quot;text&quot; value=&quot;&quot;  /&gt;
+                                &lt;input id=&quot;add-menu&quot; type=&quot;submit&quot; value=&quot;&lt;?php esc_attr_e('Add Menu'); ?&gt;&quot; name=&quot;add-menu&quot; class=&quot;button&quot; /&gt;
</ins><span class="cx">                                 &lt;/span&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
</span><del>-&lt;?php /* ?&gt;
-                &lt;?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?&gt;
-                &lt;div class=&quot;widgets-holder-wrap&quot; style=&quot;display:none;&quot;&gt;
-                        &lt;div class=&quot;sidebar-name&quot;&gt;
-                                &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
-                                &lt;h3&gt;&lt;?php esc_html_e('Top Level Menu Descriptions'); ?&gt;&lt;/h3&gt;
-                        &lt;/div&gt;
-                        &lt;div class=&quot;widget-holder&quot;&gt;
-                                &lt;span&gt;&lt;?php _e('Display Descriptions in Top Level Menu?'); ?&gt;&lt;/span&gt;
-
-                                &lt;?php
-                                // UPDATE and DISPLAY Menu Description Option
-                                if ( isset($_POST['menu-descriptions']) ) {
-                                        if ( !isset($_POST['switch_menu']) ) {
-                                                $menu_options_to_edit = $_POST['menu_id_in_edit'];
-                                                update_option('wp_settings_custom_nav_'.$menu_options_to_edit.'_descriptions',$_POST['menu-descriptions']);
-                                        }
-                                }
-
-                                if ( $menu_id_in_edit &gt; 0 )
-                                        $checkedraw = get_option('wp_settings_custom_nav_'.$menu_id_in_edit.'_descriptions');
-                                else
-                                        $checkedraw = get_option('wp_settings_custom_nav_'.$menu_selected_id.'_descriptions');
-
-                                $checked = strtolower($checkedraw);
-
-                                if ( $advanced_option_descriptions == 'no' )
-                                        $checked = 'no';
-                                ?&gt;
-
-                                &lt;span class=&quot;checkboxes&quot;&gt;
-                                        &lt;label&gt;&lt;?php _e('Yes'); ?&gt;&lt;/label&gt;&lt;input type=&quot;radio&quot; name=&quot;menu-descriptions&quot; value=&quot;yes&quot; &lt;?php if ($checked=='yes') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                        &lt;label&gt;&lt;?php _e('No'); ?&gt;&lt;/label&gt;&lt;input type=&quot;radio&quot; name=&quot;menu-descriptions&quot; value=&quot;no&quot; &lt;?php if ($checked=='yes') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                &lt;/span&gt;&lt;!-- /.checkboxes --&gt;
-                                &lt;/form&gt;
-                                &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
-                        &lt;/div&gt;
-                &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
-&lt;?php */ ?&gt;
</del><span class="cx">                 &lt;div class=&quot;widgets-holder-wrap&quot;&gt;
</span><span class="cx">                         &lt;div class=&quot;sidebar-name&quot;&gt;
</span><span class="cx">                                 &lt;div class=&quot;sidebar-name-arrow&quot;&gt;&lt;/div&gt;
</span><span class="cx">                                 &lt;h3&gt;&lt;?php esc_html_e('Add an Existing Page'); ?&gt;&lt;/h3&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                         &lt;div class=&quot;widget-holder&quot;&gt;
</span><del>-
-                                &lt;?php
-                                $pages_args = array(
-                                'child_of' =&gt; 0,
-                                'sort_order' =&gt; 'ASC',
-                                'sort_column' =&gt; 'post_title',
-                                'hierarchical' =&gt; 1,
-                                'exclude' =&gt; '',
-                                'include' =&gt; '',
-                                'meta_key' =&gt; '',
-                                'meta_value' =&gt; '',
-                                'authors' =&gt; '',
-                                'parent' =&gt; -1,
-                                'exclude_tree' =&gt; '',
-                                'number' =&gt; '',
-                                'offset' =&gt; 0 );
-
-                                //GET all pages
-                                $pages_array = get_pages($pages_args);
-                                $page_name = '';
-                                //CHECK if pages exist
-                                if ( $pages_array ) {
-                                        foreach ( $pages_array as $post ) {
-                                                //Add page name to
-                                                $page_name .= htmlentities($post-&gt;post_title).'|';
-                                        }
-                                } else {
-                                        $page_name = __('No pages available');
-                                }
-                                ?&gt;
-
-                                &lt;script&gt;
</del><ins>+&lt;?php
+        $pages_args = array(
+                'child_of' =&gt; 0,
+                'sort_order' =&gt; 'ASC',
+                'sort_column' =&gt; 'post_title',
+                'hierarchical' =&gt; 1,
+                'exclude' =&gt; '',
+                'include' =&gt; '',
+                'meta_key' =&gt; '',
+                'meta_value' =&gt; '',
+                'authors' =&gt; '',
+                'parent' =&gt; -1,
+                'exclude_tree' =&gt; '',
+                'number' =&gt; '',
+                'offset' =&gt; 0
+        );
+        $page_name = '';
+        $pages_array = get_pages($pages_args);
+        if ( $pages_array ) {
+                foreach ( $pages_array as $post ) {
+                        $page_name .= $post-&gt;post_title . '|';
+                }
+        } else {
+                $page_name = __('No pages available');
+        }
+?&gt;
+                                &lt;script type=&quot;text/javascript&quot; charset=&quot;&lt;?php bloginfo('charset'); ?&gt;&quot;&gt;
</ins><span class="cx">                                         jQuery(document).ready(function(){
</span><del>-
-                                                //GET PHP pages
-                                                var dataposts = &quot;&lt;?php echo esc_js($page_name); ?&gt;&quot;.split(&quot;|&quot;);
-
-                                                //Set autocomplete
-                                                jQuery(&quot;#page-search&quot;).autocomplete(dataposts);
-
-                                                //Handle autocomplete result
</del><ins>+                                                var posts = &quot;&lt;?php echo esc_js( $page_name ); ?&gt;&quot;.split(&quot;|&quot;);
+                                                jQuery(&quot;#page-search&quot;).autocomplete(posts);
</ins><span class="cx">                                                 jQuery(&quot;#page-search&quot;).result(function(event, data, formatted) {
</span><span class="cx">                                                         jQuery('#existing-pages').css('display','block');
</span><span class="cx">                                                         jQuery(&quot;#existing-pages dt:contains('&quot; + data + &quot;')&quot;).css(&quot;display&quot;, &quot;block&quot;);
</span><del>-
</del><span class="cx">                                                         jQuery('#show-pages').hide();
</span><span class="cx">                                                         jQuery('#hide-pages').show();
</span><del>-
</del><span class="cx">                                                 });
</span><span class="cx">                                                 jQuery('#existing-pages').css('display','none');
</span><span class="cx">                                         });
</span><span class="cx">                                 &lt;/script&gt;
</span><del>-
</del><span class="cx">                                 &lt;input type=&quot;text&quot; onfocus=&quot;jQuery('#page-search').attr('value','');&quot; id=&quot;page-search&quot; value=&quot;&lt;?php esc_attr_e('Search Pages'); ?&gt;&quot; /&gt;
</span><span class="cx"> 
</span><del>-                                &lt;a id=&quot;show-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();&quot;&gt;View All&lt;/a&gt;
-                                &lt;a id=&quot;hide-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();&quot;&gt;Hide All&lt;/a&gt;
</del><ins>+                                &lt;a id=&quot;show-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','block');jQuery('#page-search').attr('value','');jQuery('#existing-pages dt').css('display','block');jQuery('#show-pages').hide();jQuery('#hide-pages').show();&quot;&gt;&lt;?php _e('View All'); ?&gt;&lt;/a&gt;
+                                &lt;a id=&quot;hide-pages&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-pages').css('display','none');jQuery('#page-search').attr('value','Search Pages');jQuery('#existing-pages dt').css('display','none');jQuery('#show-pages').show();jQuery('#hide-pages').hide();&quot;&gt;&lt;?php _e('Hide All'); ?&gt;&lt;/a&gt;
</ins><span class="cx"> 
</span><span class="cx">                                 &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="cx">                                         jQuery('#hide-pages').hide();
</span><span class="cx">                                 &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;ul id=&quot;existing-pages&quot; class=&quot;list&quot;&gt;
</span><del>-                                        &lt;?php
-                                                $intCounter = 0;
-                                                //Get default Pages
-                                                $intCounter = wp_nav_menu_get_pages($intCounter,'default');
-                                        ?&gt;
</del><ins>+&lt;?php
+        $items_counter = wp_nav_menu_get_pages( 0,'default' );
+?&gt;
</ins><span class="cx">                                 &lt;/ul&gt;
</span><del>-
</del><span class="cx">                                 &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
</span><del>-
</del><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -359,76 +297,59 @@
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                         &lt;div class=&quot;widget-holder&quot;&gt;
</span><span class="cx"> 
</span><del>-                                &lt;?php
-                                // Custom GET categories query
-                                // @todo Use API
-                                $categories = $wpdb-&gt;get_results(&quot;SELECT term_id FROM $wpdb-&gt;term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC&quot;);
-                                $cat_name = '';
-                                //CHECK for results
-                                if ( $categories ) {
-                                        foreach ( $categories as $category ) {
-                                                $cat_id = $category-&gt;term_id;
-
-                                                $cat_args = array(
-                                                        'orderby' =&gt; 'name',
-                                                        'include' =&gt; $cat_id,
-                                                        'hierarchical' =&gt; 1,
-                                                        'order' =&gt; 'ASC'
-                                                );
-
-                                                $category_names=get_categories($cat_args);
-
-                                                if ( isset($category_names[0]-&gt;name) ) {
-                                                        // Add category name to data string
-                                                        $cat_name .= htmlentities($category_names[0]-&gt;name).'|';
-                                                }
-                                        }
-                                } else {
-                                        $cat_name = __('No categories available');
-                                }
-                                ?&gt;
-
-                                &lt;script&gt;
</del><ins>+&lt;?php
+        // Custom GET categories query
+        // @todo Use API
+        $categories = $wpdb-&gt;get_results(&quot;SELECT term_id FROM $wpdb-&gt;term_taxonomy WHERE taxonomy = 'category' ORDER BY term_id ASC&quot;);
+        $cat_name = '';
+        if ( $categories ) {
+                foreach ( $categories as $category ) {
+                        $cat_id = $category-&gt;term_id;
+                        $cat_args = array(
+                                'orderby' =&gt; 'name',
+                                'include' =&gt; $cat_id,
+                                'hierarchical' =&gt; 1,
+                                'order' =&gt; 'ASC',
+                        );
+                        $category_names = get_categories( $cat_args );
+                        if ( isset( $category_names[0]-&gt;name ) ) {
+                                $cat_name .= htmlentities( $category_names[0]-&gt;name ).'|';
+                        }
+                }
+        } else {
+                $cat_name = __('No categories available');
+        }
+?&gt;
+                                &lt;script type=&quot;text/javascript&quot; charset=&quot;&lt;?php bloginfo('charset'); ?&gt;&quot;&gt;
</ins><span class="cx">                                         jQuery(document).ready(function(){
</span><del>-
-                                                //GET PHP categories
-                                                var datacats = &quot;&lt;?php echo esc_js($cat_name); ?&gt;&quot;.split(&quot;|&quot;);
-
-                                                //Set autocomplete
-                                                jQuery(&quot;#cat-search&quot;).autocomplete(datacats);
-
-                                                //Handle autocomplete result
</del><ins>+                                                var categories = &quot;&lt;?php echo esc_js($cat_name); ?&gt;&quot;.split(&quot;|&quot;);
+                                                jQuery(&quot;#cat-search&quot;).autocomplete(categories);
</ins><span class="cx">                                                 jQuery(&quot;#cat-search&quot;).result(function(event, data, formatted) {
</span><span class="cx">                                                         jQuery('#existing-categories').css('display','block');
</span><span class="cx">                                                         jQuery(&quot;#existing-categories dt:contains('&quot; + data + &quot;')&quot;).css(&quot;display&quot;, &quot;block&quot;);
</span><del>-
</del><span class="cx">                                                         jQuery('#show-cats').hide();
</span><span class="cx">                                                         jQuery('#hide-cats').show();
</span><del>-
</del><span class="cx">                                                 });
</span><span class="cx">                                                 jQuery('#existing-categories').css('display','none');
</span><del>-
</del><span class="cx">                                         });
</span><span class="cx">                                 &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;input type=&quot;text&quot; onfocus=&quot;jQuery('#cat-search').attr('value','');&quot; id=&quot;cat-search&quot; value=&quot;&lt;?php esc_attr_e('Search Categories'); ?&gt;&quot; /&gt;
</span><span class="cx"> 
</span><del>-                                &lt;a id=&quot;show-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();&quot;&gt;View All&lt;/a&gt;
-                                &lt;a id=&quot;hide-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();&quot;&gt;Hide All&lt;/a&gt;
</del><ins>+                                &lt;a id=&quot;show-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','block');jQuery('#cat-search').attr('value','');jQuery('#existing-categories dt').css('display','block');jQuery('#show-cats').hide();jQuery('#hide-cats').show();&quot;&gt;&lt;?php _e('View All'); ?&gt;&lt;/a&gt;
+                                &lt;a id=&quot;hide-cats&quot; style=&quot;cursor:pointer;&quot; onclick=&quot;jQuery('#existing-categories').css('display','none');jQuery('#cat-search').attr('value','Search Categories');jQuery('#existing-categories dt').css('display','none');jQuery('#show-cats').show();jQuery('#hide-cats').hide();&quot;&gt;&lt;?php _e('Hide All'); ?&gt;&lt;/a&gt;
</ins><span class="cx"> 
</span><span class="cx">                                 &lt;script type=&quot;text/javascript&quot;&gt;
</span><span class="cx">                                         jQuery('#hide-cats').hide();
</span><span class="cx">                                 &lt;/script&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;ul id=&quot;existing-categories&quot; class=&quot;list&quot;&gt;
</span><del>-                                        &lt;?php
-                                                // Get default Categories
-                                                $intCounter = wp_nav_menu_get_categories($intCounter, 'default');
-                                        ?&gt;
</del><ins>+&lt;?php
+        $items_counter = wp_nav_menu_get_categories( $items_counter, 'default' );
+?&gt;
</ins><span class="cx">                                 &lt;/ul&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
</span><del>-
</del><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -438,15 +359,15 @@
</span><span class="cx">                                 &lt;h3&gt;&lt;?php esc_html_e('Add a Custom Url'); ?&gt;&lt;/h3&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                         &lt;div class=&quot;widget-holder&quot;&gt;
</span><del>-                                &lt;input id=&quot;custom_menu_item_url&quot; type=&quot;text&quot; value=&quot;http://&quot;  /&gt;
-                                &lt;label&gt;&lt;?php _e('URL'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;?php $templatedir = get_bloginfo('url'); ?&gt;
-                                &lt;input type=&quot;hidden&quot; id=&quot;templatedir&quot; value=&quot;&lt;?php echo esc_attr($templatedir); ?&gt;&quot; /&gt;
-                                &lt;input id=&quot;custom_menu_item_name&quot; type=&quot;text&quot; value=&quot;Menu Item&quot; onfocus=&quot;jQuery('#custom_menu_item_name').attr('value','');&quot;  /&gt;
-                                &lt;label&gt;&lt;?php _e('Menu Text'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</del><ins>+                                &lt;input id=&quot;custom-menu-item-url&quot; type=&quot;text&quot; value=&quot;http://&quot;  /&gt;
+                                &lt;label for=&quot;custom-menu-item-url&quot;&gt;&lt;?php _e('URL'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                                &lt;?php $template_dir = get_bloginfo('url'); ?&gt;
+                                &lt;input type=&quot;hidden&quot; id=&quot;template-dir&quot; value=&quot;&lt;?php echo esc_attr($template_dir); ?&gt;&quot; /&gt;
+                                &lt;input id=&quot;custom-menu-item-name&quot; type=&quot;text&quot; value=&quot;&lt;?php echo esc_attr( __('Menu Item') ); ?&gt;&quot; onfocus=&quot;jQuery('#custom-menu-item-name').attr('value','');&quot;  /&gt;
+                                &lt;label for=&quot;custom-menu-item-name&quot;&gt;&lt;?php _e('Menu Text'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</ins><span class="cx">                                 &lt;input id=&quot;custom_menu_item_description&quot; type=&quot;text&quot; value=&quot;&lt;?php esc_attr_e('A description'); ?&gt;&quot; &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; onfocus=&quot;jQuery('#custom_menu_item_description').attr('value','');&quot; /&gt;
</span><span class="cx">                                 &lt;label &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt; &gt;&lt;?php _e('Description'); ?&gt;&lt;/label&gt;
</span><del>-                                &lt;a class=&quot;addtomenu&quot; onclick=&quot;appendToList('&lt;?php echo $templatedir; ?&gt;','Custom','','','','0','');jQuery('#custom_menu_item_name').attr('value','Menu Item');jQuery('#custom_menu_item_description').attr('value','A description');&quot;&gt;&lt;?php _e('Add to menu'); ?&gt;&lt;/a&gt;
</del><ins>+                                &lt;a class=&quot;addtomenu&quot; onclick=&quot;appendToList('&lt;?php echo $template_dir; ?&gt;','&lt;?php echo esc_js( _x('Custom', 'menu nav item type') ); ?&gt;','','','','0','');jQuery('#custom-menu-item-name').attr('value','&lt;?php echo esc_js( __('Menu Item') ); ?&gt;');jQuery('#custom_menu_item_description').attr('value','&lt;?php echo esc_js( __('A description') ); ?&gt;');&quot;&gt;&lt;?php _e('Add to menu'); ?&gt;&lt;/a&gt;
</ins><span class="cx">                                 &lt;div class=&quot;fix&quot;&gt;&lt;/div&gt;
</span><span class="cx">                         &lt;/div&gt;
</span><span class="cx">                 &lt;/div&gt;&lt;!-- /.widgets-holder-wrap --&gt;
</span><span class="lines">@@ -455,7 +376,7 @@
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div id=&quot;dialog-confirm&quot; style=&quot;display:none;&quot; title=&quot;&lt;?php esc_attr_e('Edit Menu Item'); ?&gt;&quot;&gt;
</span><del>-        &lt;/label&gt;&lt;input id=&quot;edittitle&quot; type=&quot;text&quot; name=&quot;edittitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;edittitle&quot;&gt;&lt;?php _e('Menu Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</del><ins>+        &lt;input id=&quot;edittitle&quot; type=&quot;text&quot; name=&quot;edittitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;edittitle&quot;&gt;&lt;?php _e('Menu Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</ins><span class="cx">         &lt;input id=&quot;editlink&quot; type=&quot;text&quot; name=&quot;editlink&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editlink&quot;&gt;&lt;?php _e('URL'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</span><span class="cx">         &lt;input id=&quot;editanchortitle&quot; type=&quot;text&quot; name=&quot;editanchortitle&quot; value=&quot;&quot; /&gt;&lt;label class=&quot;editlabel&quot; for=&quot;editanchortitle&quot;&gt;&lt;?php _e('Link Title'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</span><span class="cx">         &lt;select id=&quot;editnewwindow&quot; name=&quot;editnewwindow&quot;&gt;
</span><span class="lines">@@ -467,4 +388,4 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;?php
</span><span class="cx"> 
</span><del>-include(&quot;admin-footer.php&quot;);
</del><ins>+include(&quot;admin-footer.php&quot;);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-widgets.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-widgets.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/default-widgets.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -1120,18 +1120,8 @@
</span><span class="cx">                                         &lt;ul class=&quot;custom-nav&quot;&gt;
</span><span class="cx">                                         &lt;?php
</span><span class="cx">                                 }
</span><del>-
-                        ?&gt;
-
-                                                &lt;?php
-                                                        //DISPLAY custom navigation menu
-                                                        if ( get_option('wp_custom_nav_menu') == 'true' )
-                                                        wp_nav_menu( array('id' =&gt; $navmenu, 'name' =&gt; $wp_custom_nav_menu_name, 'desc' =&gt; $navwidgetdescription, 'format' =&gt; 'widget') );
-                                                ?&gt;
-
-                                &lt;?php
-
-                                        //DEVELOPER settings enabled
</del><ins>+                                wp_nav_menu( array('id' =&gt; $navmenu, 'name' =&gt; $wp_custom_nav_menu_name, 'desc' =&gt; $navwidgetdescription, 'format' =&gt; 'widget') );
+                                //DEVELOPER settings enabled
</ins><span class="cx">                                         if ( $navdeveloper == 'yes' ) {
</span><span class="cx">                                                 //DISPLAY Custom UL
</span><span class="cx">                                                 if ( $navul == 'yes' ) {
</span></span></pre></div>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/nav-menu-template.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">                                                 &lt;?php if ( 'backend' == $context ) { ?&gt;
</span><span class="cx">                                                 &lt;a&gt;&lt;span class=&quot;&quot;&gt;&lt;/span&gt;&lt;/a&gt;
</span><span class="cx">                                                 &lt;?php } else { ?&gt;
</span><del>-                                                &lt;a class=&quot;hide&quot; href=&quot;&lt;?php echo $menu_item-&gt;link; ?&gt;&quot;&gt;&lt;?php echo $menu_item-&gt;title; ?&gt;&lt;/a&gt;
</del><ins>+                                                &lt;a class=&quot;hide&quot; href=&quot;&lt;?php echo $menu_item-&gt;link; ?&gt;&quot;&gt;&lt;?php echo esc_html( $menu_item-&gt;title ); ?&gt;&lt;/a&gt;
</ins><span class="cx">                                                 &lt;?php } ?&gt;
</span><span class="cx">                                                 &lt;input type=&quot;hidden&quot; name=&quot;dbid&lt;?php echo $menu_item-&gt;menu_order; ?&gt;&quot; id=&quot;dbid&lt;?php echo $menu_item-&gt;menu_order; ?&gt;&quot; value=&quot;&lt;?php echo $menu_item-&gt;ID; ?&gt;&quot; /&gt;
</span><span class="cx">                                                 &lt;input type=&quot;hidden&quot; name=&quot;postmenu&lt;?php echo $menu_item-&gt;menu_order; ?&gt;&quot; id=&quot;postmenu&lt;?php echo $menu_item-&gt;menu_order; ?&gt;&quot; value=&quot;&lt;?php echo esc_attr( get_post_meta( $menu_item-&gt;ID, 'object_id', true ) ); ?&gt;&quot; /&gt;
</span><span class="lines">@@ -148,11 +148,13 @@
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">                 case 'default':
</span><del>-                        $templatedir = get_bloginfo('url');
</del><ins>+                        $template_dir = get_bloginfo('url');
</ins><span class="cx"> ?&gt;
</span><span class="cx">                                         &lt;dl&gt;
</span><del>-                                        &lt;dt&gt;
-                                        &lt;span class=&quot;title&quot;&gt;&lt;?php echo $menu_item-&gt;title; ?&gt;&lt;/span&gt; &lt;a onclick=&quot;appendToList('&lt;?php echo esc_js( esc_url_raw( $templatedir ) ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;append ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;title ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;link ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;ID ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;parent_item ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;description ); ?&gt;')&quot; name=&quot;&lt;?php echo esc_attr( $menu_item-&gt;title ); ?&gt;&quot; value=&quot;&lt;?php echo esc_attr( $menu_item-&gt;link ); ?&gt;&quot;&gt;&lt;img alt=&quot;&lt;?php esc_attr_e('Add to Custom Menu'); ?&gt;&quot; title=&quot;&lt;?php esc_attr_e('Add to Custom Menu'); ?&gt;&quot; src=&quot;&lt;?php echo admin_url('images/ico-add.png'); ?&gt;&quot; /&gt;&lt;/a&gt; &lt;/dt&gt;
</del><ins>+                                                &lt;dt&gt;
+                                                        &lt;span class=&quot;title&quot;&gt;&lt;?php echo $menu_item-&gt;title; ?&gt;&lt;/span&gt;
+                                                        &lt;a onclick=&quot;appendToList('&lt;?php echo esc_js( esc_url_raw( $template_dir ) ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;append ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;title ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;link ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;ID ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;parent_item ); ?&gt;','&lt;?php echo esc_js( $menu_item-&gt;description ); ?&gt;')&quot; name=&quot;&lt;?php echo esc_attr( $menu_item-&gt;title ); ?&gt;&quot; value=&quot;&lt;?php echo esc_attr( $menu_item-&gt;link ); ?&gt;&quot;&gt;&lt;img alt=&quot;&lt;?php esc_attr_e('Add to Custom Menu'); ?&gt;&quot; title=&quot;&lt;?php esc_attr_e('Add to Custom Menu'); ?&gt;&quot; src=&quot;&lt;?php echo admin_url('images/ico-add.png'); ?&gt;&quot; /&gt;&lt;/a&gt;
+                                                &lt;/dt&gt;
</ins><span class="cx">                                         &lt;/dl&gt;
</span><span class="cx"> &lt;?php
</span><span class="cx">                 break;
</span></span></pre></div>
<a id="trunkwpincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/nav-menu.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -25,7 +25,7 @@
</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 WP_Error('menu_exists', sprintf( __('A menu named &quot;%s&quot; already exists; please try another name.'), $menu_exists-&gt;name ));
</del><ins>+                return new WP_Error('menu_exists', sprintf( __('A menu named &amp;#8220;%s&amp;#8221; already exists; please try another name.'), esc_html( $menu_exists-&gt;name ) ) );
</ins><span class="cx"> 
</span><span class="cx">         $menu = wp_insert_term( $menu_name, 'nav_menu' );
</span><span class="cx">         if ( is_wp_error($menu) )
</span><span class="lines">@@ -97,16 +97,16 @@
</span><span class="cx">                         $menu_item-&gt;link = get_page_link( $menu_item-&gt;object_id );
</span><span class="cx"> 
</span><span class="cx">                         if ( $menu_item-&gt;post_title == '' )
</span><del>-                                $menu_item-&gt;title = htmlentities( get_the_title( $menu_item-&gt;object_id ) );
</del><ins>+                                $menu_item-&gt;title = get_the_title( $menu_item-&gt;object_id );
</ins><span class="cx">                         else
</span><del>-                                $menu_item-&gt;title = htmlentities( $menu_item-&gt;post_title );
</del><ins>+                                $menu_item-&gt;title = $menu_item-&gt;post_title;
</ins><span class="cx"> 
</span><span class="cx">                         if ( $menu_item-&gt;post_content == '' )
</span><del>-                                $menu_item-&gt;description = htmlentities( get_post_meta( $menu_item-&gt;ID, 'page-description', true ) );
</del><ins>+                                $menu_item-&gt;description = get_post_meta( $menu_item-&gt;ID, 'page-description', true );
</ins><span class="cx">                         else
</span><del>-                                $menu_item-&gt;description = htmlentities( $menu_item-&gt;post_content );
</del><ins>+                                $menu_item-&gt;description = $menu_item-&gt;post_content;
</ins><span class="cx">                         $menu_item-&gt;target = '';
</span><del>-                        $menu_item-&gt;append = 'Page';
</del><ins>+                        $menu_item-&gt;append = _x('Page', 'menu nav item type');
</ins><span class="cx">                 break;
</span><span class="cx">                 // Category Menu Item
</span><span class="cx">                 case 'category':
</span><span class="lines">@@ -114,25 +114,25 @@
</span><span class="cx"> 
</span><span class="cx">                         if ( empty($menu_item-&gt;post_title) ) {
</span><span class="cx">                                 $title_raw = get_category( $menu_item-&gt;object_id );
</span><del>-                                $menu_item-&gt;title =  htmlentities($title_raw-&gt;cat_name);
</del><ins>+                                $menu_item-&gt;title =  $title_raw-&gt;cat_name;
</ins><span class="cx">                         } else {
</span><del>-                                $menu_item-&gt;title = htmlentities( $menu_item-&gt;post_title );
</del><ins>+                                $menu_item-&gt;title = $menu_item-&gt;post_title;
</ins><span class="cx">                         }
</span><span class="cx"> 
</span><span class="cx">                         if ( empty($menu_item-&gt;post_content) )
</span><del>-                                $menu_item-&gt;description = htmlentities( strip_tags( category_description( $menu_item-&gt;object_id ) ) );
</del><ins>+                                $menu_item-&gt;description = strip_tags( category_description( $menu_item-&gt;object_id ) );
</ins><span class="cx">                         else
</span><del>-                                $menu_item-&gt;description = htmlentities( $menu_item-&gt;post_content );
</del><ins>+                                $menu_item-&gt;description = $menu_item-&gt;post_content;
</ins><span class="cx">                         $menu_item-&gt;target = '';
</span><del>-                        $menu_item-&gt;append = 'Category';
</del><ins>+                        $menu_item-&gt;append = _x('Category', 'menu nav item type');
</ins><span class="cx">                 break;
</span><span class="cx">                 default:
</span><span class="cx">                         // Custom Menu Item
</span><span class="cx">                         $menu_item-&gt;link = $menu_item-&gt;guid;
</span><del>-                        $menu_item-&gt;title =  htmlentities( $menu_item-&gt;post_title );
-                        $menu_item-&gt;description = htmlentities( $menu_item-&gt;post_content );
</del><ins>+                        $menu_item-&gt;title =  $menu_item-&gt;post_title;
+                        $menu_item-&gt;description = $menu_item-&gt;post_content;
</ins><span class="cx">                         $menu_item-&gt;target = 'target=&quot;_blank&quot;';
</span><del>-                        $menu_item-&gt;append = 'Custom';
</del><ins>+                        $menu_item-&gt;append = _x('Custom', 'menu nav item type');
</ins><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> 
</span><span class="cx">                         //SET anchor title
</span><span class="cx">                         if (isset($wp_custom_nav_menu_items-&gt;custom_anchor_title)) {
</span><del>-                                $anchor_title = htmlentities($wp_custom_nav_menu_items-&gt;custom_anchor_title);
</del><ins>+                                $anchor_title = $wp_custom_nav_menu_items-&gt;custom_anchor_title;
</ins><span class="cx">                         }
</span><span class="cx">                         else {
</span><span class="cx">                                 $anchor_title = $title;
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (13374 => 13375)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2010-02-24 17:31:42 UTC (rev 13374)
+++ trunk/wp-includes/script-loader.php        2010-02-24 18:52:54 UTC (rev 13375)
</span><span class="lines">@@ -398,7 +398,13 @@
</span><span class="cx"> 
</span><span class="cx">                 // Custom Navigation
</span><span class="cx">                 $scripts-&gt;add( 'custom-navigation-default-items', &quot;/wp-admin/js/custom-navigation-default-items$suffix.js&quot;, false, '20100223' );
</span><del>-                $scripts-&gt;add( 'custom-navigation-dynamic-functions', &quot;/wp-admin/js/custom-navigation-dynamic-functions$suffix.js&quot;, false, '20100220' );
</del><ins>+                $scripts-&gt;add( 'custom-navigation-dynamic-functions', &quot;/wp-admin/js/custom-navigation-dynamic-functions$suffix.js&quot;, false, '20100224' );
+                $scripts-&gt;localize( 'custom-navigation-dynamic-functions', 'navMenuL10n', array(
+                        'custom' =&gt; _x('Custom', 'menu nav item type'),
+                        'page' =&gt; _x('Page', 'menu nav item type'),
+                        'category' =&gt; _x('Category', 'menu nav item type')
+                ) );
+                
</ins><span class="cx">                 $scripts-&gt;add( 'custom-navigation-php-functions', &quot;/wp-admin/js/custom-navigation-php-functions$suffix.js&quot;, false, '20100220' );
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -468,7 +474,7 @@
</span><span class="cx">         $styles-&gt;add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
</span><span class="cx">         $styles-&gt;add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
</span><span class="cx">         $styles-&gt;add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
</span><del>-        $styles-&gt;add( 'custom-navigation', &quot;/wp-admin/css/custom-navigation$suffix.css&quot;, array(), '20100223' );
</del><ins>+        $styles-&gt;add( 'custom-navigation', &quot;/wp-admin/css/custom-navigation$suffix.css&quot;, array(), '20100224' );
</ins><span class="cx"> 
</span><span class="cx">         foreach ( $rtl_styles as $rtl_style ) {
</span><span class="cx">                 $styles-&gt;add_data( $rtl_style, 'rtl', true );
</span></span></pre>
</div>
</div>

</body>
</html>