From c4b63151a539020a6f04421eb5e364dd905a1139 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Thu, 28 Jan 2010 20:20:18 +0000 Subject: [PATCH] Don't both hooking in menu functions which will never get called. See #11922 props miqrogroove. git-svn-id: https://develop.svn.wordpress.org/trunk@12891 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index e10f9d68af..a73bed751e 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -594,7 +594,7 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio $admin_page_hooks[$file] = sanitize_title( $menu_title ); $hookname = get_plugin_page_hookname( $file, '' ); - if (!empty ( $function ) && !empty ( $hookname )) + if (!empty ( $function ) && !empty ( $hookname ) && current_user_can( $access_level ) ) add_action( $hookname, $function ); if ( empty($icon_url) ) {