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
This commit is contained in:
parent
93fc30b2a0
commit
c4b63151a5
@ -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) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user