Ticket #18662: 18662.diff
File 18662.diff, 1.3 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/plugin.php
1509 1509 return $page_type . '_page_' . $plugin_name; 1510 1510 } 1511 1511 1512 function admin_page_exists() { 1513 global $plugin_page; 1514 global $_registered_pages; 1515 // it's not an plugin setting page, so never mind 1516 if ( ! $plugin_page ) 1517 return true; 1518 $parent = get_admin_page_parent(); 1519 $hookname = get_plugin_page_hookname( $plugin_page, $parent ); 1520 if ( ! isset( $_registered_pages[$hookname] ) ) 1521 return false; 1522 return true; 1523 } 1524 1512 1525 function user_can_access_admin_page() { 1513 1526 global $pagenow; 1514 1527 global $menu; -
wp-admin/includes/menu.php
220 220 unset( $menu[ $last_menu_key ] ); 221 221 unset( $last_menu_key ); 222 222 223 if ( ! admin_page_exists() ) { 224 do_action( 'admin_page_not_exists' ); 225 wp_die( 'Plugin setting page does not exist.' ); 226 } 227 223 228 if ( !user_can_access_admin_page() ) { 224 229 do_action('admin_page_access_denied'); 225 230 wp_die( __('You do not have sufficient permissions to access this page.') );