<!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>[14721] trunk/wp-includes: Inline docs for menu location functions.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14721">14721</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-05-18 05:59:25 +0000 (Tue, 18 May 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Inline docs for menu location functions. props jorbin, see <a href="http://trac.wordpress.org/ticket/13378">#13378</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (14720 => 14721)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-05-18 04:58:18 UTC (rev 14720)
+++ trunk/wp-includes/nav-menu-template.php        2010-05-18 05:59:25 UTC (rev 14721)
</span><span class="lines">@@ -183,8 +183,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">  * context - the context the menu is used in.
</span><del>- * 
- * @todo show_home - If you set this argument, then it will display the link to the home page. The show_home argument really just needs to be set to the value of the text of the link.
</del><ins>+ * 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.
</ins><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span><span class="cx">  *
</span></span></pre></div>
<a id="trunkwpincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu.php (14720 => 14721)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu.php        2010-05-18 04:58:18 UTC (rev 14720)
+++ trunk/wp-includes/nav-menu.php        2010-05-18 05:59:25 UTC (rev 14721)
</span><span class="lines">@@ -12,8 +12,11 @@
</span><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span><span class="cx">  *
</span><del>- * @param string $menu Menu id
- * @return mixed $menu|false Or WP_Error
</del><ins>+ * @uses get_term
+ * @uses get_term_by
+ *
+ * @param string $menu Menu id, slug or name
+ * @return mixed false if $menu param isn't supplied or term does not exist, menu object if successfull
</ins><span class="cx">  */
</span><span class="cx"> function wp_get_nav_menu_object( $menu ) {
</span><span class="cx">         if ( ! $menu )
</span><span class="lines">@@ -41,7 +44,7 @@
</span><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span><span class="cx">  *
</span><del>- * @param int|string $menu The menu to check
</del><ins>+ * @param int|string $menu The menu to check (id, slug, or name)
</ins><span class="cx">  * @return bool Whether the menu exists.
</span><span class="cx">  */
</span><span class="cx"> function is_nav_menu( $menu ) {
</span><span class="lines">@@ -87,11 +90,23 @@
</span><span class="cx"> function register_nav_menu( $location, $description ) {
</span><span class="cx">         register_nav_menus( array( $location =&gt; $description ) );
</span><span class="cx"> }
</span><del>-
</del><ins>+/**
+ * Returns an array of all registered nav menus in a theme
+ *
+ * @since 3.0.0
+ * @return array
+ */
</ins><span class="cx"> function get_registered_nav_menus() {
</span><span class="cx">         return $GLOBALS['_wp_registered_nav_menus'];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+/**
+ * Returns an array with the registered nav menu locations and the menu assigned to it
+ *
+ * @since 3.0.0
+ * @return array
+ */
+
</ins><span class="cx"> function get_nav_menu_locations() {
</span><span class="cx">         return get_theme_mod('nav_menu_locations');
</span><span class="cx"> }
</span><span class="lines">@@ -468,20 +483,20 @@
</span><span class="cx">                         $object_id = get_post_meta( $item-&gt;ID, '_menu_item_object_id', true );
</span><span class="cx">                         $object = get_post_meta( $item-&gt;ID, '_menu_item_object', true );
</span><span class="cx">                         $type = get_post_meta( $item-&gt;ID, '_menu_item_type', true );
</span><del>-        
</del><ins>+
</ins><span class="cx">                         if ( 'post_type' == $type )
</span><span class="cx">                                 $posts[$object][] = $object_id;
</span><span class="cx">                         elseif ( 'taxonomy' == $type)
</span><span class="cx">                                 $terms[$object][] = $object_id;
</span><span class="cx">                 }
</span><del>-        
</del><ins>+
</ins><span class="cx">                 if ( !empty($posts) ) {
</span><span class="cx">                         foreach ( array_keys($posts) as $post_type ) {
</span><span class="cx">                                 get_posts( array('post__in' =&gt; $posts[$post_type], 'post_type' =&gt; $post_type, 'nopaging' =&gt; true, 'update_post_term_cache' =&gt; false) );
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 unset($posts);
</span><del>-        
</del><ins>+
</ins><span class="cx">                 if ( !empty($terms) ) {
</span><span class="cx">                         foreach ( array_keys($terms) as $taxonomy ) {
</span><span class="cx">                                 get_terms($taxonomy, array('include' =&gt; $terms[$taxonomy]) );
</span></span></pre>
</div>
</div>

</body>
</html>