summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-admin/menu-header.php
diff options
context:
space:
mode:
Diffstat (limited to 'wp-inst/wp-admin/menu-header.php')
-rw-r--r--wp-inst/wp-admin/menu-header.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/wp-inst/wp-admin/menu-header.php b/wp-inst/wp-admin/menu-header.php
index b661146..6807a9e 100644
--- a/wp-inst/wp-admin/menu-header.php
+++ b/wp-inst/wp-admin/menu-header.php
@@ -11,7 +11,7 @@ foreach ($menu as $item) {
// 0 = name, 1 = user_level, 2 = file
if (( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
- if ($user_level >= $item[1]) {
+ if ( current_user_can($item[1]) ) {
if ( file_exists(ABSPATH . "wp-content/plugins/{$item[2]}") )
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/admin.php?page={$item[2]}'$class>{$item[0]}</a></li>";
else
@@ -31,9 +31,8 @@ if ( isset($submenu["$parent_file"]) ) :
<ul id="adminmenu2">
<?php
foreach ($submenu["$parent_file"] as $item) :
- if ($user_level < $item[1]) {
+ if ( !current_user_can($item[1]) )
continue;
- }
if ( isset($submenu_file) ) {
if ( $submenu_file == $item[2] ) $class = ' class="current"';
@@ -55,4 +54,4 @@ endforeach;
?>
</ul>
-<?php endif; ?> \ No newline at end of file
+<?php endif; ?>