<!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>[13388] trunk/wp-includes/default-widgets.php:
  Formatting cleanups for the nav menu widget.</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Formatting cleanups for the nav menu widget. see <a href="http://trac.wordpress.org/ticket/11817">#11817</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesdefaultwidgetsphp">trunk/wp-includes/default-widgets.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesdefaultwidgetsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/default-widgets.php (13387 => 13388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/default-widgets.php        2010-02-24 21:30:13 UTC (rev 13387)
+++ trunk/wp-includes/default-widgets.php        2010-02-24 21:33:27 UTC (rev 13388)
</span><span class="lines">@@ -1066,11 +1066,8 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         $navwidgetdescription = $instance['navwidgetdescription'];
</span><span class="cx">                 }
</span><del>-                $menuexists = false;
</del><span class="cx"> 
</span><del>-                global $wpdb;
-
-                // GET menu name
</del><ins>+                // Get menu
</ins><span class="cx">                 if ( $navmenu &gt; 0 ) {
</span><span class="cx">                         $custom_menu = get_term( (int) $nav_menu, 'nav_menu' );
</span><span class="cx">                         $wp_custom_nav_menu_name = $custom_menu-&gt;name;
</span><span class="lines">@@ -1078,98 +1075,72 @@
</span><span class="cx">                 } else {
</span><span class="cx">                         $menuexists = false;
</span><span class="cx">                 }
</span><del>-                ?&gt;
</del><span class="cx"> 
</span><del>-                &lt;?php
-                        //DEVELOPER settings enabled
-                        if ( $navdeveloper == 'yes' ) {
-                                //DISPLAY Custom DIV
-                                if ( $navdiv == 'yes' ) {
-                                        ?&gt;
-                                        &lt;div id=&quot;&lt;?php echo $navdivid;  ?&gt;&quot; class=&quot;&lt;?php echo $navdivclass; ?&gt;&quot;&gt;
-                                        &lt;?php
</del><ins>+                if ( $navdeveloper == 'yes' ) {
+                        // DISPLAY Custom DIV
+                        if ( $navdiv == 'yes' ) {
+                        ?&gt;
+                                &lt;div id=&quot;&lt;?php echo $navdivid;  ?&gt;&quot; class=&quot;&lt;?php echo $navdivclass; ?&gt;&quot;&gt;
+                        &lt;?php
</ins><span class="cx">                                 }
</span><del>-                        }
-                        //DISPLAY default DIV
-                        else {
</del><ins>+                        } else {
+                                //DISPLAY default DIV
</ins><span class="cx">                                 ?&gt;
</span><span class="cx">                                 &lt;div class=&quot;widget&quot;&gt;
</span><span class="cx">                                 &lt;?php
</span><span class="cx">                         }
</span><span class="cx">                 ?&gt;
</span><span class="cx"> 
</span><del>-                        &lt;h3&gt;&lt;?php echo $navtitle; ?&gt;&lt;/h3&gt;
-                        &lt;?php
-
-                        if ( $menuexists ) {
-                                ?&gt;
-                        &lt;?php
-
-                        //DEVELOPER settings enabled
-                                if ( $navdeveloper == 'yes' ) {
-                                        //DISPLAY Custom UL
-                                        if ( $navul == 'yes' ) {
-                                                ?&gt;
-                                                &lt;ul id=&quot;&lt;?php echo $navulid;  ?&gt;&quot; class=&quot;&lt;?php echo $navulclass; ?&gt;&quot;&gt;
-                                                &lt;?php
-                                        }
-                                }
-                                //DISPLAY default UL
-                                else {
</del><ins>+                &lt;h3&gt;&lt;?php echo $navtitle; ?&gt;&lt;/h3&gt;
+                &lt;?php
+                if ( $menuexists ) {
+                        if ( $navdeveloper == 'yes' ) {
+                                //DISPLAY Custom UL
+                                if ( $navul == 'yes' ) {
</ins><span class="cx">                                         ?&gt;
</span><del>-                                        &lt;ul class=&quot;custom-nav&quot;&gt;
</del><ins>+                                        &lt;ul id=&quot;&lt;?php echo $navulid;  ?&gt;&quot; class=&quot;&lt;?php echo $navulclass; ?&gt;&quot;&gt;
</ins><span class="cx">                                         &lt;?php
</span><span class="cx">                                 }
</span><del>-                                wp_nav_menu( array('id' =&gt; $navmenu, 'name' =&gt; $wp_custom_nav_menu_name, 'desc' =&gt; $navwidgetdescription, 'format' =&gt; 'widget') );
-                                //DEVELOPER settings enabled
-                                        if ( $navdeveloper == 'yes' ) {
-                                                //DISPLAY Custom UL
-                                                if ( $navul == 'yes' ) {
-                                                        ?&gt;
-                                                        &lt;/ul&gt;
-                                                        &lt;?php
-                                                }
-                                        }
-                                        //DISPLAY default UL
-                                        else {
-                                                ?&gt;
-                                                &lt;/ul&gt;
-                                                &lt;?php
-                                        }
-
-                                ?&gt;
-                        &lt;?php
</del><span class="cx">                         } else {
</span><del>-                                _e('You have not setup the custom navigation widget correctly, please check your settings in the backend.');
</del><ins>+                                // DISPLAY default UL
+                                ?&gt;
+                                &lt;ul class=&quot;custom-nav&quot;&gt;
+                                &lt;?php
</ins><span class="cx">                         }
</span><del>-                        ?&gt;
-                &lt;?php
-                        //DEVELOPER settings enabled
-                        if ($navdeveloper == 'yes') {
-                                //DISPLAY Custom DIV
-                                if ($navdiv == 'yes')
-                                {
</del><ins>+                        wp_nav_menu( array('id' =&gt; $navmenu, 'name' =&gt; $wp_custom_nav_menu_name, 'desc' =&gt; $navwidgetdescription, 'format' =&gt; 'widget') );
+                        if ( $navdeveloper == 'yes' ) {
+                                //DISPLAY Custom UL
+                                if ( $navul == 'yes' ) {
</ins><span class="cx">                                         ?&gt;
</span><del>-                                        &lt;/div&gt;
</del><ins>+                                        &lt;/ul&gt;
</ins><span class="cx">                                         &lt;?php
</span><span class="cx">                                 }
</span><del>-                                //Do NOT display DIV
-                                else
-                                {
-
-                                }
-
</del><ins>+                        } else {
+                                //DISPLAY default UL
+                                ?&gt;
+                                &lt;/ul&gt;
+                                &lt;?php
</ins><span class="cx">                         }
</span><del>-                        //DISPLAY default DIV
-                        else
-                        {
</del><ins>+                } else {
+                        _e('You have not setup the custom navigation widget correctly, please check your settings in the backend.');
+                }
+
+                //DEVELOPER settings enabled
+                if ($navdeveloper == 'yes') {
+                        // DISPLAY Custom DIV
+                        if ( $navdiv == 'yes' ) {
</ins><span class="cx">                                 ?&gt;
</span><span class="cx">                                 &lt;/div&gt;
</span><span class="cx">                                 &lt;?php
</span><span class="cx">                         }
</span><del>-                ?&gt;&lt;!-- /#nav-container --&gt;
-
</del><ins>+                } else {
+                        // DISPLAY default DIV
+                        ?&gt;
+                        &lt;/div&gt;
</ins><span class="cx">                         &lt;?php
</span><ins>+                }
+                ?&gt;&lt;!-- /#nav-container --&gt;
+                &lt;?php
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         function update($new_instance, $old_instance) {
</span><span class="lines">@@ -1193,162 +1164,112 @@
</span><span class="cx">                 // Get menus
</span><span class="cx">                 $custom_menus = get_terms( 'nav_menu', array( 'hide_empty' =&gt; false ) );
</span><span class="cx"> 
</span><del>-                if ( $custom_menus ) {
-                        ?&gt;
</del><ins>+                if ( !$custom_menus) {
+                ?&gt;
+                        &lt;p&gt;
+                            &lt;label&gt;&lt;?php printf(__('No menus have been created yet.  &lt;a href=&quot;%s&quot;&gt;Creat some&lt;/a&gt;.'), admin_url('nav-menus.php')); ?&gt;&lt;/label&gt;
+                        &lt;/p&gt;
+                &lt;?php
+                        return;
+                }
+                ?&gt;
</ins><span class="cx"> 
</span><del>-                         &lt;p&gt;
-                    &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navmenu'); ?&gt;&quot;&gt;&lt;?php _e('Select Menu:'); ?&gt;&lt;/label&gt;
</del><ins>+                &lt;p&gt;
+                        &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navmenu'); ?&gt;&quot;&gt;&lt;?php _e('Select Menu:'); ?&gt;&lt;/label&gt;
</ins><span class="cx"> 
</span><del>-                                &lt;select id=&quot;&lt;?php echo $this-&gt;get_field_id('navmenu'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navmenu'); ?&gt;&quot;&gt;
</del><ins>+                        &lt;select id=&quot;&lt;?php echo $this-&gt;get_field_id('navmenu'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navmenu'); ?&gt;&quot;&gt;
+                                &lt;?php
+                                foreach ( $custom_menus as $menu ) {
+                                        if ( $navmenu == $menu-&gt;term_id )
+                                                $selected_option = 'selected=&quot;selected&quot;';
+                                        else
+                                                $selected_option = '';
+                                        ?&gt;
+                                        &lt;option value=&quot;&lt;?php echo $menu-&gt;term_id; ?&gt;&quot; &lt;?php echo $selected_option; ?&gt;&gt;&lt;?php echo $menu-&gt;name; ?&gt;&lt;/option&gt;
</ins><span class="cx">                                         &lt;?php
</span><ins>+                                }
+                                ?&gt;
+                        &lt;/select&gt;
+                &lt;/p&gt;
</ins><span class="cx"> 
</span><del>-                                        //DISPLAY SELECT OPTIONS
-                                        foreach ( $custom_menus as $menu ) {
-                                                if ( $navmenu == $menu-&gt;term_id) {
-                                                        $selected_option = 'selected=&quot;selected&quot;';
-                                                } else {
-                                                        $selected_option = '';
-                                                }
-                                                ?&gt;
-                                                &lt;option value=&quot;&lt;?php echo $menu-&gt;term_id; ?&gt;&quot; &lt;?php echo $selected_option; ?&gt;&gt;&lt;?php echo $menu-&gt;name; ?&gt;&lt;/option&gt;
-                                                &lt;?php
</del><ins>+                &lt;p&gt;
+                        &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navtitle'); ?&gt;&quot;&gt;&lt;?php _e('Title:'); ?&gt;&lt;/label&gt;
+                        &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navtitle'); ?&gt;&quot; value=&quot;&lt;?php echo $navtitle; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navtitle'); ?&gt;&quot; /&gt;
+                &lt;/p&gt;
</ins><span class="cx"> 
</span><del>-                                        }
-                                        ?&gt;
-                                &lt;/select&gt;
-
-                        &lt;/p&gt;
-
-                        &lt;p&gt;
-                        &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navtitle'); ?&gt;&quot;&gt;&lt;?php _e('Title:'); ?&gt;&lt;/label&gt;
-                            &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navtitle'); ?&gt;&quot; value=&quot;&lt;?php echo $navtitle; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navtitle'); ?&gt;&quot; /&gt;
-                    &lt;/p&gt;
-
-                    &lt;p&gt;
-                        &lt;?php
-                            $checked = strtolower($navdeveloper);
-                        ?&gt;
-
</del><ins>+                &lt;?php $checked = strtolower($navdeveloper); ?&gt;
+                &lt;p&gt;
</ins><span class="cx">                         &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navdeveloper'); ?&gt;&quot;&gt;&lt;?php _e('Advanced Options:'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</span><span class="cx">                         &lt;span class=&quot;checkboxes&quot;&gt;
</span><del>-                                   &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; value=&quot;yes&quot; &lt;?php if ($checked=='yes') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                            &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; value=&quot;no&quot; &lt;?php if ($checked=='yes') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
</del><ins>+                                &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; value=&quot;yes&quot; &lt;?php if ($checked=='yes') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
+                                &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdeveloper'); ?&gt;&quot; value=&quot;no&quot; &lt;?php if ($checked=='yes') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
</ins><span class="cx">                         &lt;/span&gt;&lt;!-- /.checkboxes --&gt;
</span><ins>+                &lt;/p&gt;
</ins><span class="cx"> 
</span><del>-                        &lt;/p&gt;
</del><ins>+                &lt;?php
+                // Advanced settings
+                if ( $checked == 'yes' ) :
+                ?&gt;
+                &lt;p&gt;
+                &lt;?php $checked = strtolower($navdiv); ?&gt;
+                        &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navdiv'); ?&gt;&quot;&gt;&lt;?php _e('Wrap in container DIV:'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                        &lt;span class=&quot;checkboxes&quot;&gt;
+                                &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&quot; value=&quot;yes&quot; &lt;?php if ($checked=='yes') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
+                                &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&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;/p&gt;
+                &lt;?php
+                if ( $checked == 'yes' ) {
+                ?&gt;
</ins><span class="cx"> 
</span><del>-                    &lt;?php
-
-                    //DEVELOPER settings
-                    if ($checked == 'yes')
-                    {
-                            ?&gt;
-
-                            &lt;p&gt;
-                                &lt;?php
-                                    $checked = strtolower($navdiv);
-                                ?&gt;
-
-                                &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navdiv'); ?&gt;&quot;&gt;&lt;?php _e('Wrap in container DIV:'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;span class=&quot;checkboxes&quot;&gt;
-                                           &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&quot; value=&quot;yes&quot; &lt;?php if ($checked=='yes') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                    &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdiv'); ?&gt;&quot; value=&quot;no&quot; &lt;?php if ($checked=='yes') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                &lt;/span&gt;&lt;!-- /.checkboxes --&gt;
-
</del><ins>+                        &lt;p&gt;
+                                &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navdivid'); ?&gt;&quot;&gt;&lt;?php _e('DIV id:'); ?&gt;&lt;/label&gt;
+                                &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdivid'); ?&gt;&quot; value=&quot;&lt;?php echo $navdivid; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navdivid'); ?&gt;&quot; /&gt;
</ins><span class="cx">                         &lt;/p&gt;
</span><del>-
-                        &lt;?php
-
-                        if ( $checked == 'yes' ) {
-
-                                ?&gt;
-
-                                &lt;p&gt;
-
-                            &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navdivid'); ?&gt;&quot;&gt;&lt;?php _e('DIV id:'); ?&gt;&lt;/label&gt;
-                            &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdivid'); ?&gt;&quot; value=&quot;&lt;?php echo $navdivid; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navdivid'); ?&gt;&quot; /&gt;
-                        &lt;/p&gt;
-                        &lt;p&gt;
-
-                            &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navdivclass'); ?&gt;&quot;&gt;&lt;?php _e('DIV class:'); ?&gt;&lt;/label&gt;
-                            &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdivclass'); ?&gt;&quot; value=&quot;&lt;?php echo $navdivclass; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navdivclass'); ?&gt;&quot; /&gt;
-                        &lt;/p&gt;
-
-                                &lt;?php
-
-                        }
-
-                        ?&gt;
-
</del><span class="cx">                         &lt;p&gt;
</span><del>-                                &lt;?php
-                                    $checked = strtolower($navul);
-                                ?&gt;
-
-                                &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navul'); ?&gt;&quot;&gt;&lt;?php _e('Wrap in container UL:'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;span class=&quot;checkboxes&quot;&gt;
-                                           &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&quot; value=&quot;yes&quot; &lt;?php if ($checked=='yes') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                    &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&quot; value=&quot;no&quot; &lt;?php if ($checked=='yes') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                &lt;/span&gt;&lt;!-- /.checkboxes --&gt;
-
</del><ins>+                                &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navdivclass'); ?&gt;&quot;&gt;&lt;?php _e('DIV class:'); ?&gt;&lt;/label&gt;
+                                &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navdivclass'); ?&gt;&quot; value=&quot;&lt;?php echo $navdivclass; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navdivclass'); ?&gt;&quot; /&gt;
</ins><span class="cx">                         &lt;/p&gt;
</span><ins>+                &lt;?php
+                }
+                
+                $checked = strtolower($navul);
+                ?&gt;
</ins><span class="cx"> 
</span><del>-                        &lt;?php
</del><ins>+                &lt;p&gt;
+                        &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navul'); ?&gt;&quot;&gt;&lt;?php _e('Wrap in container UL:'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                        &lt;span class=&quot;checkboxes&quot;&gt;
+                                &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&quot; value=&quot;yes&quot; &lt;?php if ($checked=='yes') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
+                                &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navul'); ?&gt;&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;/p&gt;
</ins><span class="cx"> 
</span><del>-                        if ($checked == 'yes')
-                        {
-
-                                ?&gt;
-
-                                &lt;p&gt;
-
-                            &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navulid'); ?&gt;&quot;&gt;&lt;?php _e('UL id:'); ?&gt;&lt;/label&gt;
-                            &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navulid'); ?&gt;&quot; value=&quot;&lt;?php echo $navulid; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navulid'); ?&gt;&quot; /&gt;
-                        &lt;/p&gt;
-                        &lt;p&gt;
-
-                            &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navulclass'); ?&gt;&quot;&gt;&lt;?php _e('UL class:'); ?&gt;&lt;/label&gt;
-                            &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navulclass'); ?&gt;&quot; value=&quot;&lt;?php echo $navulclass; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navulclass'); ?&gt;&quot; /&gt;
-                        &lt;/p&gt;
-
-                                &lt;?php
-
-                        }
-
-                        ?&gt;
-                        &lt;?php $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options'); ?&gt;
-                        &lt;p &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt;&gt;
-
-                   &lt;?php
-                                    $checked = strtolower($navwidgetdescription);
-                                ?&gt;
-
-                                &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navwidgetdescription'); ?&gt;&quot;&gt;&lt;?php _e('Show Top Level Descriptions:'); ?&gt;&lt;/label&gt;&lt;br /&gt;
-                                &lt;span class=&quot;checkboxes&quot;&gt;
-                                           &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; value=&quot;1&quot; &lt;?php if ($checked=='1') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                    &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; value=&quot;2&quot; &lt;?php if ($checked=='1') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
-                                &lt;/span&gt;&lt;!-- /.checkboxes --&gt;
-                &lt;/p&gt;
-                            &lt;?php
-                    }
-                    //Do nothing
-                    else
-                    {
-
-                    }
-
-                }
-                //Error message for menus not existing
-                else
-                {
-                        ?&gt;
</del><ins>+                &lt;?php
+                if ( $checked == 'yes' ) {
+                ?&gt;
</ins><span class="cx">                         &lt;p&gt;
</span><del>-                            &lt;label&gt;&lt;?php _e('The Custom Navigation has not been configured correctly.  Please check your Custom Navigation settings before adding this widget.'); ?&gt;&lt;/label&gt;
</del><ins>+                                &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navulid'); ?&gt;&quot;&gt;&lt;?php _e('UL id:'); ?&gt;&lt;/label&gt;
+                                &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navulid'); ?&gt;&quot; value=&quot;&lt;?php echo $navulid; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navulid'); ?&gt;&quot; /&gt;
</ins><span class="cx">                         &lt;/p&gt;
</span><del>-                        &lt;?php
</del><ins>+                        &lt;p&gt;
+                                &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navulclass'); ?&gt;&quot;&gt;&lt;?php _e('UL class:'); ?&gt;&lt;/label&gt;
+                                &lt;input type=&quot;text&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navulclass'); ?&gt;&quot; value=&quot;&lt;?php echo $navulclass; ?&gt;&quot; class=&quot;widefat&quot; id=&quot;&lt;?php echo $this-&gt;get_field_id('navulclass'); ?&gt;&quot; /&gt;
+                        &lt;/p&gt;
+                &lt;?php
</ins><span class="cx">                 }
</span><ins>+                $advanced_option_descriptions = get_option('wp_settings_custom_nav_advanced_options');
+                ?&gt;
+                &lt;p &lt;?php if ($advanced_option_descriptions == 'no') { ?&gt;style=&quot;display:none;&quot;&lt;?php } ?&gt;&gt;
+                   &lt;?php $checked = strtolower($navwidgetdescription); ?&gt;
+                        &lt;label for=&quot;&lt;?php echo $this-&gt;get_field_id('navwidgetdescription'); ?&gt;&quot;&gt;&lt;?php _e('Show Top Level Descriptions:'); ?&gt;&lt;/label&gt;&lt;br /&gt;
+                        &lt;span class=&quot;checkboxes&quot;&gt;
+                                &lt;label&gt;Yes&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; value=&quot;1&quot; &lt;?php if ($checked=='1') { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
+                                &lt;label&gt;No&lt;/label&gt;&lt;input type=&quot;radio&quot; id=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; name=&quot;&lt;?php echo $this-&gt;get_field_name('navwidgetdescription'); ?&gt;&quot; value=&quot;2&quot; &lt;?php if ($checked=='1') { } else { echo 'checked=&quot;checked&quot;'; } ?&gt; /&gt;
+                        &lt;/span&gt;&lt;!-- /.checkboxes --&gt;
+                &lt;/p&gt;
+                &lt;?php
+                endif;
</ins><span class="cx">         }
</span><del>-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span></span></pre>
</div>
</div>

</body>
</html>