<!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>[12845] trunk/wp-admin/menu.php: unset temp vars in menu.php so they don'
t pollute the global namespace.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12845">12845</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-26 18:09:45 +0000 (Tue, 26 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>unset temp vars in menu.php so they don't pollute the global namespace.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (12844 => 12845)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-01-26 17:55:51 UTC (rev 12844)
+++ trunk/wp-admin/menu.php        2010-01-26 18:09:45 UTC (rev 12845)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx">
</span><span class="cx">                 $submenu['edit.php'][$i++] = array( esc_attr($tax->label), 'manage_categories', 'edit-tags.php?taxonomy=' . $tax->name );
</span><span class="cx">         }
</span><ins>+        unset($tax);
</ins><span class="cx">
</span><span class="cx"> $menu[10] = array( __('Media'), 'upload_files', 'upload.php', '', 'menu-top', 'menu-media', 'div' );
</span><span class="cx">         $submenu['upload.php'][5] = array( __('Library'), 'upload_files', 'upload.php');
</span><span class="lines">@@ -113,7 +114,7 @@
</span><span class="cx">                 if ( !is_multisite() )
</span><span class="cx">                         $submenu['plugins.php'][15] = array( _x('Editor', 'plugin editor'), 'edit_plugins', 'plugin-editor.php' );
</span><span class="cx"> }
</span><del>-unset($menu_perms);
</del><ins>+unset($menu_perms, $update_plugins, $update_count);
</ins><span class="cx">
</span><span class="cx"> if ( current_user_can('edit_users') )
</span><span class="cx">         $menu[70] = array( __('Users'), 'edit_users', 'users.php', '', 'menu-top', 'menu-users', 'div' );
</span><span class="lines">@@ -188,6 +189,7 @@
</span><span class="cx">
</span><span class="cx">         $admin_page_hooks[$menu_page[2]] = $hook_name;
</span><span class="cx"> }
</span><ins>+unset($menu_page);
</ins><span class="cx">
</span><span class="cx"> $_wp_submenu_nopriv = array();
</span><span class="cx"> $_wp_menu_nopriv = array();
</span><span class="lines">@@ -200,11 +202,14 @@
</span><span class="cx">                                 $_wp_submenu_nopriv[$parent][$data[2]] = true;
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><ins>+                unset($index, $data);
</ins><span class="cx">
</span><span class="cx">                 if ( empty(${$sub_loop}[$parent]) )
</span><span class="cx">                         unset(${$sub_loop}[$parent]);
</span><span class="cx">         }
</span><ins>+        unset($sub, $parent);
</ins><span class="cx"> }
</span><ins>+unset($sub_loop);
</ins><span class="cx">
</span><span class="cx"> // Loop over the top-level menu.
</span><span class="cx"> // Menus for which the original parent is not acessible due to lack of privs will have the next
</span><span class="lines">@@ -226,12 +231,13 @@
</span><span class="cx">                         $submenu[$new_parent][$index] = $submenu[$old_parent][$index];
</span><span class="cx">                         unset($submenu[$old_parent][$index]);
</span><span class="cx">                 }
</span><del>-                unset($submenu[$old_parent]);
</del><ins>+                unset($submenu[$old_parent], $index);
</ins><span class="cx">
</span><span class="cx">                 if ( isset($_wp_submenu_nopriv[$old_parent]) )
</span><span class="cx">                         $_wp_submenu_nopriv[$new_parent] = $_wp_submenu_nopriv[$old_parent];
</span><span class="cx">         }
</span><span class="cx"> }
</span><ins>+unset($id, $data, $subs, $first_sub, $old_parent, $new_parent);
</ins><span class="cx">
</span><span class="cx"> do_action('admin_menu', '');
</span><span class="cx">
</span><span class="lines">@@ -249,6 +255,7 @@
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><ins>+unset($id, $data);
</ins><span class="cx">
</span><span class="cx"> // Remove any duplicated seperators
</span><span class="cx"> $seperator_found = false;
</span><span class="lines">@@ -264,9 +271,8 @@
</span><span class="cx">                 $seperator_found = false;
</span><span class="cx">         }
</span><span class="cx"> }
</span><ins>+unset($id, $data);
</ins><span class="cx">
</span><del>-unset($id);
-
</del><span class="cx"> function add_cssclass($add, $class) {
</span><span class="cx">         $class = empty($class) ? $add : $class .= ' ' . $add;
</span><span class="cx">         return $class;
</span></span></pre>
</div>
</div>
</body>
</html>