<!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>[16055] trunk/wp-includes/admin-bar/admin-bar-superadmin.php:
  Lose the snack menu.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16055">16055</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-10-28 17:29:44 +0000 (Thu, 28 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Lose the snack menu. see <a href="http://trac.wordpress.org/ticket/14772">#14772</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesadminbaradminbarsuperadminphp">trunk/wp-includes/admin-bar/admin-bar-superadmin.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesadminbaradminbarsuperadminphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/admin-bar/admin-bar-superadmin.php (16054 => 16055)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/admin-bar/admin-bar-superadmin.php        2010-10-28 17:19:37 UTC (rev 16054)
+++ trunk/wp-includes/admin-bar/admin-bar-superadmin.php        2010-10-28 17:29:44 UTC (rev 16055)
</span><span class="lines">@@ -10,8 +10,6 @@
</span><span class="cx">         /* Add the main superadmin menu item */
</span><span class="cx">         $wp_admin_bar-&gt;add_menu( array(  'id' =&gt; 'superadmin', 'title' =&gt; '&amp;mu;', 'href' =&gt; '', 'meta' =&gt; array( 'class' =&gt; 'ab-sadmin' ), ) );
</span><span class="cx"> 
</span><del>-        wp_admin_bar_build_snackmenu();
-
</del><span class="cx">         /* Get the settings we need for the current site */
</span><span class="cx">         $matureaction = $current_blog-&gt;mature ? 'unmatureblog' : 'matureblog';
</span><span class="cx">         $maturetext_confirm = $current_blog-&gt;mature ? 
</span><span class="lines">@@ -45,138 +43,4 @@
</span><span class="cx">         $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; 'superadmin', 'title' =&gt; ( $current_blog-&gt;spam ? __('Unsuspend site') : __('Suspend site') ), 'href' =&gt; $suspend_url, 'position' =&gt; 80, ) );
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function wp_admin_bar_build_snackmenu() {
-        global $wp_admin_bar, $menu, $submenu, $pagenow;
-
-        // Hide moderation count, filter removed at the bottom of this function
-        add_filter( 'wp_count_comments', 'wp_admin_bar_removemodcount' );
-
-        require_once( ABSPATH . 'wp-admin/includes/admin.php' );
-
-        // menu.php assumes it is in the global scope and relies on the $wp_taxonomies global array
-        $wp_taxonomies = array();
-        require_once( ABSPATH . 'wp-admin/menu.php' );
-
-        /* Add the snack menu submenu to the superadmin menu */
-        $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; 'superadmin', 'title' =&gt; __( 'Snack Menu' ), 'href' =&gt; '/wp-admin/',) );
-
-        /* Loop through the submenus and add them */
-        foreach ( (array) $menu as $key =&gt; $item ) {
-                $admin_is_parent = false;
-                $submenu_as_parent = false;
-
-                if ( $submenu_as_parent &amp;&amp; !empty($submenu[$item[2]]) ) {
-                        $submenu[$item[2]] = array_values($submenu[$item[2]]);  // Re-index.
-                        $menu_hook = get_plugin_page_hook($submenu[$item[2]][0][2], $item[2]);
-                        $menu_file = $submenu[$item[2]][0][2];
-        
-                        if ( false !== $pos = strpos($menu_file, '?') )
-                                $menu_file = substr($menu_file, 0, $pos);
-
-                        if ( 
-                                ( 
-                                        'index.php' != $submenu[$item[2]][0][2] &amp;&amp; 
-                                        file_exists( WP_PLUGIN_DIR . &quot;/$menu_file&quot; )
-                                ) || 
-                                ! empty( $menu_hook )
-                        ) {
-                                
-                                $admin_is_parent = true;
-                                $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; 'snack-menu', 'title' =&gt; $item[0], 'href' =&gt; admin_url(&quot;admin.php?page={$submenu[$item[2]][0][2]}&quot;), ) );
-
-                        } else {
-                                $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; 'snack-menu', 'title' =&gt; $item[0], 'href' =&gt; admin_url(&quot;{$submenu[$item[2]][0][2]}&quot;), ) );
-                        }
-                } else if ( current_user_can($item[1]) ) {
-                        $menu_hook = get_plugin_page_hook($item[2], 'admin.php');
-                        $menu_file = $item[2];
-
-                        if ( false !== $pos = strpos($menu_file, '?') )
-                                $menu_file = substr($menu_file, 0, $pos);
-
-                        if ( 
-                                ( 
-                                        'index.php' != $item[2] &amp;&amp; 
-                                        file_exists( WP_PLUGIN_DIR . &quot;/$menu_file&quot; ) 
-                                ) || 
-                                ! empty($menu_hook) 
-                        ) {
-
-                                $admin_is_parent = true;
-                                $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; 'snack-menu', 'title' =&gt; $item[0], 'href' =&gt; admin_url(&quot;admin.php?page={$item[2]}&quot;), ) );
-                        } else {
-                                $wp_admin_bar-&gt;add_menu( array(  'parent' =&gt; 'snack-menu', 'title' =&gt; $item[0], 'href' =&gt; admin_url(&quot;{$item[2]}&quot;), ) );
-                        }
-                }
-
-                if ( ! empty($submenu[$item[2]]) ) {
-                        $first = true;
-                        $unique_submenu = array();
-                        
-                        foreach ( $submenu[$item[2]] as $sub_key =&gt; $sub_item ) {
-                                if ( !current_user_can($sub_item[1]) || in_array( $sub_item[0], $unique_submenu ) )
-                                        continue;
-                        
-                                $unique_submenu[] = $sub_item[0];
-                                
-                                if ( $first )
-                                        $first = false;
-                                
-                                $menu_file = $item[2];
-                                if ( false !== $pos = strpos($menu_file, '?') )
-                                        $menu_file = substr($menu_file, 0, $pos);
-                                
-                                $menu_hook = get_plugin_page_hook($sub_item[2], $item[2]);
-                                $sub_file = $sub_item[2];
-
-                                if ( false !== $pos = strpos($sub_file, '?') )
-                                        $sub_file = substr($sub_file, 0, $pos);
-                                
-                                if (
-                                        ( 
-                                                'index.php' != $sub_item[2] &amp;&amp; 
-                                                file_exists( WP_PLUGIN_DIR . &quot;/$sub_file&quot; ) 
-                                        ) || 
-                                        ! empty($menu_hook) 
-                                ) {
-                                        // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
-                                        if (
-                                                ( 
-                                                        ! $admin_is_parent &amp;&amp; 
-                                                        file_exists(WP_PLUGIN_DIR . &quot;/$menu_file&quot;) &amp;&amp; 
-                                                        ! is_dir(WP_PLUGIN_DIR . &quot;/{$item[2]}&quot;)
-                                                ) || 
-                                                file_exists( $menu_file ) 
-                                        ) {
-                                                $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; sanitize_title( $item[0] ), 'title' =&gt; $sub_item[0], 'href' =&gt; admin_url(&quot;{$item[2]}?page={$sub_item[2]}&quot;), ) );
-                                        } else {
-                                                $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; sanitize_title( $item[0] ), 'title' =&gt; $sub_item[0], 'href' =&gt; admin_url(&quot;admin.php?page={$sub_item[2]}&quot;), ) );
-                                        }
-                                } else {
-                                        $wp_admin_bar-&gt;add_menu( array( 'parent' =&gt; sanitize_title( $item[0] ), 'title' =&gt; $sub_item[0], 'href' =&gt; admin_url(&quot;{$sub_item[2]}&quot;), ) );
-                                }
-                        }
-                }
-        }
-
-        remove_filter( 'wp_count_comments', 'wp_admin_bar_removemodcount' );
-}
-
-// Short circuits wp_count_comments() for the front end
-function wp_admin_bar_removemodcount( $stats ) {
-        if ( is_admin() )
-                return $stats;
-
-        $stats = array(
-                'moderated'      =&gt; 0,
-                'approved'       =&gt; 0,
-                'spam'           =&gt; 0,
-                'trash'          =&gt; 0,
-                'post-trashed'   =&gt; 0,
-                'total_comments' =&gt; 0,
-        );
-
-        return (object) $stats;
-}
-
</del><span class="cx"> ?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>