Only check once, good idea: http://mosquito.wordpress.org/view.php?id=371
git-svn-id: https://develop.svn.wordpress.org/trunk@1958 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f730b81576
commit
15e91b7b10
@ -12,16 +12,10 @@ foreach ($menu as $item) {
|
||||
if ((substr($self, -10) == substr($item[2], -10) && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file))) $class = ' class="current"';
|
||||
|
||||
if ($user_level >= $item[1]) {
|
||||
if (
|
||||
('upload.php' == $item[2] &&
|
||||
get_settings('use_fileupload') &&
|
||||
($user_level >= get_settings('fileupload_minlevel'))
|
||||
) || 'upload.php' != $item[2]) {
|
||||
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
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
||||
}
|
||||
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
|
||||
echo "\n\t<li><a href='" . get_settings('siteurl') . "/wp-admin/{$item[2]}'$class>{$item[0]}</a></li>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,8 @@ $menu[25] = array(__('Users'), 0, 'profile.php');
|
||||
$menu[30] = array(__('Options'), 6, 'options-general.php');
|
||||
$menu[35] = array(__('Plugins'), 8, 'plugins.php');
|
||||
$menu[40] = array(__('Presentation'), 8, 'themes.php');
|
||||
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
|
||||
if ( get_option('use_fileupload') )
|
||||
$menu[45] = array(__('Upload'), get_settings('fileupload_minlevel'), 'upload.php');
|
||||
|
||||
$submenu['post.php'][5] = array(__('Write Post'), 1, 'post.php');
|
||||
$submenu['post.php'][10] = array(__('Write Page'), 5, 'page-new.php');
|
||||
|
Loading…
Reference in New Issue
Block a user