<!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>[15075] trunk: Remove vestigial 'context' code for wp_nav_menu.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/15075">15075</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-05-31 14:54:50 +0000 (Mon, 31 May 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove vestigial 'context' code for wp_nav_menu. This was used when we used to use the same function as a theme template tag and admin template function (now we don't.) fixes <a href="http://trac.wordpress.org/ticket/13656">#13656</a>.</pre>

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

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminadminajaxphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/admin-ajax.php (15074 => 15075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/admin-ajax.php        2010-05-31 14:15:28 UTC (rev 15074)
+++ trunk/wp-admin/admin-ajax.php        2010-05-31 14:54:50 UTC (rev 15075)
</span><span class="lines">@@ -833,7 +833,6 @@
</span><span class="cx">                 $args = array(
</span><span class="cx">                         'after' =&gt; '',
</span><span class="cx">                         'before' =&gt; '',
</span><del>-                        'context' =&gt; 'backend',
</del><span class="cx">                         'link_after' =&gt; '',
</span><span class="cx">                         'link_before' =&gt; '',
</span><span class="cx">                         'walker' =&gt; new Walker_Nav_Menu_Edit,
</span></span></pre></div>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (15074 => 15075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-05-31 14:15:28 UTC (rev 15074)
+++ trunk/wp-includes/nav-menu-template.php        2010-05-31 14:54:50 UTC (rev 15075)
</span><span class="lines">@@ -198,7 +198,6 @@
</span><span class="cx">  * echo - Whether to echo the menu or return it. Defaults to echo.
</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><del>- * context - the context the menu is used in.
</del><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><span class="cx">  *
</span><span class="cx">  * @since 3.0.0
</span><span class="lines">@@ -209,7 +208,7 @@
</span><span class="cx">         global $_wp_nav_menu_slugs;
</span><span class="cx">         $defaults = array( 'menu' =&gt; '', 'container' =&gt; 'div', 'container_class' =&gt; '', 'container_id' =&gt; '', 'menu_class' =&gt; 'menu', 
</span><span class="cx">         'echo' =&gt; true, 'fallback_cb' =&gt; 'wp_page_menu', 'before' =&gt; '', 'after' =&gt; '', 'link_before' =&gt; '', 'link_after' =&gt; '',
</span><del>-        'depth' =&gt; 0, 'walker' =&gt; '', 'context' =&gt; 'frontend', 'theme_location' =&gt; '' );
</del><ins>+        'depth' =&gt; 0, 'walker' =&gt; '', 'theme_location' =&gt; '' );
</ins><span class="cx"> 
</span><span class="cx">         $args = wp_parse_args( $args, $defaults );
</span><span class="cx">         $args = apply_filters( 'wp_nav_menu_args', $args );
</span><span class="lines">@@ -237,12 +236,10 @@
</span><span class="cx">         if ( $menu &amp;&amp; ! is_wp_error($menu) &amp;&amp; !isset($menu_items) )
</span><span class="cx">                 $menu_items = wp_get_nav_menu_items( $menu-&gt;term_id );
</span><span class="cx"> 
</span><del>-        // If no menu was found or if the menu has no items, call the fallback_cb
-        if ( !$menu || is_wp_error($menu) || ( isset($menu_items) &amp;&amp; empty($menu_items) ) ) {
-                if ( 'frontend' == $args-&gt;context &amp;&amp; ( function_exists($args-&gt;fallback_cb) || is_callable( $args-&gt;fallback_cb ) ) ) {
</del><ins>+        // If no menu was found or if the menu has no items, call the fallback_cb if it exists
+        if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) &amp;&amp; empty($menu_items) ) )
+                &amp;&amp; ( function_exists($args-&gt;fallback_cb) || is_callable( $args-&gt;fallback_cb ) ) )
</ins><span class="cx">                         return call_user_func( $args-&gt;fallback_cb, (array) $args );
</span><del>-                }
-        }
</del><span class="cx"> 
</span><span class="cx">         // If no fallback function was specified and the menu doesn't exists, bail.
</span><span class="cx">         if ( !$menu || is_wp_error($menu) )
</span><span class="lines">@@ -258,8 +255,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         // Set up the $menu_item variables
</span><del>-        if ( 'frontend' == $args-&gt;context )
-                _wp_menu_item_classes_by_context( $menu_items );
</del><ins>+        _wp_menu_item_classes_by_context( $menu_items );
</ins><span class="cx"> 
</span><span class="cx">         $sorted_menu_items = array();
</span><span class="cx">         foreach ( (array) $menu_items as $key =&gt; $menu_item )
</span><span class="lines">@@ -309,7 +305,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Add the class property classes for the current frontend context, if applicable.
</del><ins>+ * Add the class property classes for the current context, if applicable.
</ins><span class="cx">  *
</span><span class="cx">  * @access private
</span><span class="cx">  * @since 3.0
</span></span></pre>
</div>
</div>

</body>
</html>