<!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" />
<title>[31106] trunk/src: After [31105], don't ditch the `isset()` calls for BC.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { 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 #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#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>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/31106">31106</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/31106","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-01-08 22:51:30 +0000 (Thu, 08 Jan 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>After <a href="https://core.trac.wordpress.org/changeset/31105">[31105]</a>, don't ditch the `isset()` calls for BC. Declare `$page_hook` as `null` so it is initialized for all execution paths but will still fail `isset()` checks.
Fixes <a href="https://core.trac.wordpress.org/ticket/30958">#30958</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminadminphp">trunk/src/wp-admin/admin.php</a></li>
<li><a href="#trunksrcwpadminincludespluginphp">trunk/src/wp-admin/includes/plugin.php</a></li>
<li><a href="#trunksrcwpadminmenuheaderphp">trunk/src/wp-admin/menu-header.php</a></li>
<li><a href="#trunksrcwpincludesdeprecatedphp">trunk/src/wp-includes/deprecated.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminadminphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/admin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/admin.php 2015-01-08 22:14:58 UTC (rev 31105)
+++ trunk/src/wp-admin/admin.php 2015-01-08 22:51:30 UTC (rev 31106)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,26 +95,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // declared as globals here
</span><span class="cx" style="display: block; padding: 0 10px"> global $pagenow, $hook_suffix, $plugin_page, $typenow, $taxnow;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$page_hook = '';
-$hook_suffix = '';
-$plugin_page = '';
-$typenow = '';
-$taxnow = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$page_hook = null;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $editing = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( isset( $_GET['page'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( isset($_GET['page']) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $plugin_page = wp_unslash( $_GET['page'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $plugin_page = plugin_basename( $plugin_page );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $plugin_page = plugin_basename($plugin_page);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $typenow = $_REQUEST['post_type'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+else
+ $typenow = '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $taxnow = $_REQUEST['taxonomy'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+else
+ $taxnow = '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( WP_NETWORK_ADMIN )
</span><span class="cx" style="display: block; padding: 0 10px"> require(ABSPATH . 'wp-admin/network/menu.php');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -153,12 +151,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> do_action( 'admin_init' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( $plugin_page ) {
- if ( $typenow ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( isset($plugin_page) ) {
+ if ( !empty($typenow) )
</ins><span class="cx" style="display: block; padding: 0 10px"> $the_parent = $pagenow . '?post_type=' . $typenow;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ else
</ins><span class="cx" style="display: block; padding: 0 10px"> $the_parent = $pagenow;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><span class="cx" style="display: block; padding: 0 10px"> if ( ! $page_hook = get_plugin_page_hook($plugin_page, $the_parent) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $page_hook = get_plugin_page_hook($plugin_page, $plugin_page);
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -176,18 +173,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unset($the_parent);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( $page_hook ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$hook_suffix = '';
+if ( isset( $page_hook ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $hook_suffix = $page_hook;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-} elseif ( $plugin_page ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+} elseif ( isset( $plugin_page ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $hook_suffix = $plugin_page;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-} elseif ( $pagenow ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+} elseif ( isset( $pagenow ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $hook_suffix = $pagenow;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> set_current_screen();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle plugin admin pages.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-if ( $plugin_page ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+if ( isset($plugin_page) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $page_hook ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Fires before a particular screen is loaded.
</span></span></pre></div>
<a id="trunksrcwpadminincludespluginphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/plugin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/plugin.php 2015-01-08 22:14:58 UTC (rev 31105)
+++ trunk/src/wp-admin/includes/plugin.php 2015-01-08 22:51:30 UTC (rev 31106)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1508,7 +1508,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $parent;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $pagenow == 'admin.php' && $plugin_page ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $pagenow == 'admin.php' && isset( $plugin_page ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array)$menu as $parent_menu ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $parent_menu[2] == $plugin_page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_file = $plugin_page;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1525,7 +1525,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $parent_file = $pagenow;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_wp_real_parent_file[$parent_file] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> $parent_file = $_wp_real_parent_file[$parent_file];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1536,13 +1536,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $submenu[$parent] as $submenu_array ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_wp_real_parent_file[$parent] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = $_wp_real_parent_file[$parent];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $typenow && ($submenu_array[2] == "$pagenow?post_type=$typenow") ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( !empty($typenow) && ($submenu_array[2] == "$pagenow?post_type=$typenow") ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $parent_file = $parent;
</span><span class="cx" style="display: block; padding: 0 10px"> return $parent;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $submenu_array[2] == $pagenow && ! $typenow && ( empty($parent_file) || false === strpos($parent_file, '?') ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( $submenu_array[2] == $pagenow && empty($typenow) && ( empty($parent_file) || false === strpos($parent_file, '?') ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $parent_file = $parent;
</span><span class="cx" style="display: block; padding: 0 10px"> return $parent;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $plugin_page && ($plugin_page == $submenu_array[2] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( isset( $plugin_page ) && ($plugin_page == $submenu_array[2] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $parent_file = $parent;
</span><span class="cx" style="display: block; padding: 0 10px"> return $parent;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1575,7 +1575,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $menu_array[2] == $pagenow ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = $menu_array[3];
</span><span class="cx" style="display: block; padding: 0 10px"> return $menu_array[3];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( $plugin_page && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( isset( $plugin_page ) && ($plugin_page == $menu_array[2] ) && ($hook == $menu_array[3] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $title = $menu_array[3];
</span><span class="cx" style="display: block; padding: 0 10px"> return $menu_array[3];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1587,14 +1587,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( array_keys( $submenu ) as $parent ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $submenu[$parent] as $submenu_array ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page &&
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) &&
</ins><span class="cx" style="display: block; padding: 0 10px"> ( $plugin_page == $submenu_array[2] ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> (
</span><span class="cx" style="display: block; padding: 0 10px"> ( $parent == $pagenow ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> ( $parent == $plugin_page ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> ( $plugin_page == $hook ) ||
</span><span class="cx" style="display: block; padding: 0 10px"> ( $pagenow == 'admin.php' && $parent1 != $submenu_array[2] ) ||
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ( $typenow && $parent == $pagenow . '?post_type=' . $typenow)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ( !empty($typenow) && $parent == $pagenow . '?post_type=' . $typenow)
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = $submenu_array[3];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1615,7 +1615,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty ( $title ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $menu as $menu_array ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page &&
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) &&
</ins><span class="cx" style="display: block; padding: 0 10px"> ( $plugin_page == $menu_array[2] ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> ( $pagenow == 'admin.php' ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> ( $parent1 == $menu_array[2] ) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1670,10 +1670,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = get_admin_page_parent();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $plugin_page && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1688,25 +1688,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_wp_submenu_nopriv[$pagenow][$pagenow] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page && isset( $_wp_menu_nopriv[$plugin_page] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> foreach (array_keys( $_wp_submenu_nopriv ) as $key ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $submenu[$parent] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $submenu[$parent] as $submenu_array ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page && ( $submenu_array[2] == $plugin_page ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $plugin_page ) && ( $submenu_array[2] == $plugin_page ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( current_user_can( $submenu_array[1] ))
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> else
</span></span></pre></div>
<a id="trunksrcwpadminmenuheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/menu-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/menu-header.php 2015-01-08 22:14:58 UTC (rev 31105)
+++ trunk/src/wp-admin/menu-header.php 2015-01-08 22:51:30 UTC (rev 31106)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,7 +66,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $submenu_items = $submenu[$item[2]];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ( $parent_file && $item[2] == $parent_file ) || ( ! $typenow && $self == $item[2] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ( $parent_file && $item[2] == $parent_file ) || ( empty($typenow) && $self == $item[2] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $class[] = ! empty( $submenu_items ) ? 'wp-has-current-submenu wp-menu-open' : 'current';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $class[] = 'wp-not-current-submenu';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -167,7 +167,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $menu_file = substr( $menu_file, 0, $pos );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle current for post_type=post|page|foo pages, which won't match $self.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $self_type = $typenow ? $self . '?post_type=' . $typenow : 'nothing';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $self_type = ! empty( $typenow ) ? $self . '?post_type=' . $typenow : 'nothing';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( isset( $submenu_file ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $submenu_file == $sub_item[2] )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -175,8 +175,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // If plugin_page is set the parent must either match the current page or not physically exist.
</span><span class="cx" style="display: block; padding: 0 10px"> // This allows plugin pages with the same hook to exist under different parents.
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif (
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ( ! $plugin_page && $self == $sub_item[2] ) ||
- ( $plugin_page && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ( ! isset( $plugin_page ) && $self == $sub_item[2] ) ||
+ ( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) )
</ins><span class="cx" style="display: block; padding: 0 10px"> ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $class[] = 'current';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/deprecated.php 2015-01-08 22:14:58 UTC (rev 31105)
+++ trunk/src/wp-includes/deprecated.php 2015-01-08 22:51:30 UTC (rev 31106)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2576,7 +2576,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> global $plugin_page;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $plugin_page )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset($plugin_page) )
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span></span></pre>
</div>
</div>
</body>
</html>