<!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>[16519] trunk/wp-includes/nav-menu-template.php:
  Introduce items_wrap arg to wp_nav_menu().</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16519">16519</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-11-21 13:32:02 +0000 (Sun, 21 Nov 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Introduce items_wrap arg to wp_nav_menu(). props filosofo, fixes <a href="http://trac.wordpress.org/ticket/14235">#14235</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesnavmenutemplatephp">trunk/wp-includes/nav-menu-template.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (16518 => 16519)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-11-20 22:36:46 UTC (rev 16518)
+++ trunk/wp-includes/nav-menu-template.php        2010-11-21 13:32:02 UTC (rev 16519)
</span><span class="lines">@@ -128,6 +128,7 @@
</span><span class="cx">  * depth - how many levels of the hierarchy are to be included.  0 means all.  Defaults to 0.
</span><span class="cx">  * walker - allows a custom walker to be specified.
</span><span class="cx">  * theme_location - the location in the theme to be used.  Must be registered with register_nav_menu() in order to be selectable by the user.
</span><ins>+ * items_wrap - How the list items should be wrapped. Defaults to a ul with an id and class. Uses printf() format with numbered placeholders.
</ins><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span><span class="cx">  *
</span><span class="lines">@@ -137,7 +138,7 @@
</span><span class="cx">         static $menu_id_slugs = array();
</span><span class="cx"> 
</span><span class="cx">         $defaults = array( 'menu' =&gt; '', 'container' =&gt; 'div', 'container_class' =&gt; '', 'container_id' =&gt; '', 'menu_class' =&gt; 'menu', 'menu_id' =&gt; '',
</span><del>-        'echo' =&gt; true, 'fallback_cb' =&gt; 'wp_page_menu', 'before' =&gt; '', 'after' =&gt; '', 'link_before' =&gt; '', 'link_after' =&gt; '',
</del><ins>+        'echo' =&gt; true, 'fallback_cb' =&gt; 'wp_page_menu', 'before' =&gt; '', 'after' =&gt; '', 'link_before' =&gt; '', 'link_after' =&gt; '', 'items_wrap' =&gt; '&lt;ul id=&quot;%1$s&quot; class=&quot;%2$s&quot;&gt;%3$s&lt;/ul&gt;',
</ins><span class="cx">         'depth' =&gt; 0, 'walker' =&gt; '', 'theme_location' =&gt; '' );
</span><span class="cx"> 
</span><span class="cx">         $args = wp_parse_args( $args, $defaults );
</span><span class="lines">@@ -215,19 +216,16 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">         $menu_id_slugs[] = $slug;
</span><del>-        $attributes = ' id=&quot;' . $slug . '&quot;';
-        $attributes .= $args-&gt;menu_class ? ' class=&quot;'. $args-&gt;menu_class .'&quot;' : '';
</del><ins>+        
+        $wrap_class = $args-&gt;menu_class ? $args-&gt;menu_class : '';
</ins><span class="cx"> 
</span><del>-        $nav_menu .= '&lt;ul'. $attributes .'&gt;';
-
</del><span class="cx">         // Allow plugins to hook into the menu to add their own &lt;li&gt;'s
</span><span class="cx">         $items = apply_filters( 'wp_nav_menu_items', $items, $args );
</span><span class="cx">         $items = apply_filters( &quot;wp_nav_menu_{$menu-&gt;slug}_items&quot;, $items, $args );
</span><del>-        $nav_menu .= $items;
</del><ins>+        
+        $nav_menu .= sprintf( $args-&gt;items_wrap, $slug, $wrap_class, $items );
</ins><span class="cx">         unset($items);
</span><span class="cx"> 
</span><del>-        $nav_menu .= '&lt;/ul&gt;';
-
</del><span class="cx">         if ( $show_container )
</span><span class="cx">                 $nav_menu .= '&lt;/' . $args-&gt;container . '&gt;';
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>