<!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->add_menu( array( 'id' => 'superadmin', 'title' => '&mu;', 'href' => '', 'meta' => array( 'class' => '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->mature ? 'unmatureblog' : 'matureblog';
</span><span class="cx">         $maturetext_confirm = $current_blog->mature ?
</span><span class="lines">@@ -45,138 +43,4 @@
</span><span class="cx">         $wp_admin_bar->add_menu( array( 'parent' => 'superadmin', 'title' => ( $current_blog->spam ? __('Unsuspend site') : __('Suspend site') ), 'href' => $suspend_url, 'position' => 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->add_menu( array( 'parent' => 'superadmin', 'title' => __( 'Snack Menu' ), 'href' => '/wp-admin/',) );
-
-        /* Loop through the submenus and add them */
-        foreach ( (array) $menu as $key => $item ) {
-                $admin_is_parent = false;
-                $submenu_as_parent = false;
-
-                if ( $submenu_as_parent && !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] &&
-                                        file_exists( WP_PLUGIN_DIR . "/$menu_file" )
-                                ) ||
-                                ! empty( $menu_hook )
-                        ) {
-                                
-                                $admin_is_parent = true;
-                                $wp_admin_bar->add_menu( array( 'parent' => 'snack-menu', 'title' => $item[0], 'href' => admin_url("admin.php?page={$submenu[$item[2]][0][2]}"), ) );
-
-                        } else {
-                                $wp_admin_bar->add_menu( array( 'parent' => 'snack-menu', 'title' => $item[0], 'href' => admin_url("{$submenu[$item[2]][0][2]}"), ) );
-                        }
-                } 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] &&
-                                        file_exists( WP_PLUGIN_DIR . "/$menu_file" )
-                                ) ||
-                                ! empty($menu_hook)
-                        ) {
-
-                                $admin_is_parent = true;
-                                $wp_admin_bar->add_menu( array( 'parent' => 'snack-menu', 'title' => $item[0], 'href' => admin_url("admin.php?page={$item[2]}"), ) );
-                        } else {
-                                $wp_admin_bar->add_menu( array( 'parent' => 'snack-menu', 'title' => $item[0], 'href' => admin_url("{$item[2]}"), ) );
-                        }
-                }
-
-                if ( ! empty($submenu[$item[2]]) ) {
-                        $first = true;
-                        $unique_submenu = array();
-                        
-                        foreach ( $submenu[$item[2]] as $sub_key => $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] &&
-                                                file_exists( WP_PLUGIN_DIR . "/$sub_file" )
-                                        ) ||
-                                        ! 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 &&
-                                                        file_exists(WP_PLUGIN_DIR . "/$menu_file") &&
-                                                        ! is_dir(WP_PLUGIN_DIR . "/{$item[2]}")
-                                                ) ||
-                                                file_exists( $menu_file )
-                                        ) {
-                                                $wp_admin_bar->add_menu( array( 'parent' => sanitize_title( $item[0] ), 'title' => $sub_item[0], 'href' => admin_url("{$item[2]}?page={$sub_item[2]}"), ) );
-                                        } else {
-                                                $wp_admin_bar->add_menu( array( 'parent' => sanitize_title( $item[0] ), 'title' => $sub_item[0], 'href' => admin_url("admin.php?page={$sub_item[2]}"), ) );
-                                        }
-                                } else {
-                                        $wp_admin_bar->add_menu( array( 'parent' => sanitize_title( $item[0] ), 'title' => $sub_item[0], 'href' => admin_url("{$sub_item[2]}"), ) );
-                                }
-                        }
-                }
-        }
-
-        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' => 0,
-                'approved' => 0,
-                'spam' => 0,
-                'trash' => 0,
-                'post-trashed' => 0,
-                'total_comments' => 0,
-        );
-
-        return (object) $stats;
-}
-
</del><span class="cx"> ?>
</span></span></pre>
</div>
</div>
</body>
</html>