Ticket #29714: 29714-2.diff
File 29714-2.diff, 1.5 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/plugin.php
1663 1663 if ( !isset($_registered_pages[$hookname]) ) 1664 1664 return false; 1665 1665 } 1666 1666 $pagetest = $pagenow; 1667 1667 if ( empty( $parent) ) { 1668 if ( isset( $_wp_menu_nopriv[$pagenow] ) ) 1668 if ( $pagenow == "edit.php" && isset( $_REQUEST['post_type'] ) ) { 1669 $pagetest .= '?post_type=' . $_REQUEST['post_type' ]; 1670 } 1671 if ( isset( $_wp_menu_nopriv[$pagetest] ) ) 1669 1672 return false; 1670 if ( isset( $_wp_submenu_nopriv[$page now][$pagenow] ) )1673 if ( isset( $_wp_submenu_nopriv[$page] ) ) 1671 1674 return false; 1672 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$page now][$plugin_page] ) )1675 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$page][$plugin_page] ) ) 1673 1676 return false; 1674 1677 if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) ) 1675 1678 return false; 1676 1679 foreach (array_keys( $_wp_submenu_nopriv ) as $key ) { 1677 if ( isset( $_wp_submenu_nopriv[$key][$page now] ) )1680 if ( isset( $_wp_submenu_nopriv[$key][$page] ) ) 1678 1681 return false; 1679 1682 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$key][$plugin_page] ) ) 1680 1683 return false; … … 1692 1695 return true; 1693 1696 else 1694 1697 return false; 1695 } else if ( $submenu_array[2] == $page now) {1698 } else if ( $submenu_array[2] == $page ) { 1696 1699 if ( current_user_can( $submenu_array[1] )) 1697 1700 return true; 1698 1701 else