Changeset 1810 for trunk/wp-admin/admin-functions.php
- Timestamp:
- 10/18/2004 04:50:08 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r1792 r1810 623 623 } 624 624 625 function user_can_access_admin_page() { 626 global $parent_file; 627 global $pagenow; 628 global $menu; 629 global $submenu; 630 global $user_level; 631 632 if (! isset($parent_file)) { 633 $parent = $pagenow; 634 } else { 635 $parent = $parent_file; 636 } 637 638 foreach ($menu as $menu_array) { 639 //echo "parent array: " . $menu_array[2]; 640 if ($menu_array[2] == $parent) { 641 if ($user_level < $menu_array[1]) { 642 return false; 643 } else { 644 break; 645 } 646 } 647 } 648 649 if (isset($submenu[$parent])) { 650 foreach ($submenu[$parent] as $submenu_array) { 651 if ($submenu_array[2] == $pagenow) { 652 if ($user_level < $submenu_array[1]) { 653 return false; 654 } else { 655 return true; 656 } 657 } 658 } 659 } 660 661 return true; 662 } 663 664 function add_options_menu($title, $access_level, $file) { 665 global $submenu; 666 667 $submenu['options-general.php'][] = array($title, $access_level, $file); 668 } 669 625 670 ?>
Note: See TracChangeset
for help on using the changeset viewer.