Changeset 1818 for trunk/wp-admin/admin-functions.php
- Timestamp:
- 10/19/2004 03:03:06 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r1810 r1818 662 662 } 663 663 664 function add_options_menu($title, $access_level, $file) { 664 function get_admin_page_title() { 665 global $title; 665 666 global $submenu; 666 667 $submenu['options-general.php'][] = array($title, $access_level, $file); 667 global $pagenow; 668 global $plugin_page; 669 670 if (isset($title) && ! empty($title)) { 671 return $title; 672 } 673 674 foreach (array_keys($submenu) as $parent) { 675 foreach ($submenu[$parent] as $submenu_array) { 676 if (isset($submenu_array[3])) { 677 if ($submenu_array[2] == $pagenow) { 678 $title = $submenu_array[3]; 679 return $submenu_array[3]; 680 } else if (isset($plugin_page) && ($plugin_page == $submenu_array[2])) { 681 $title = $submenu_array[3]; 682 return $submenu_array[3]; 683 } 684 } 685 } 686 } 687 688 return ''; 689 } 690 691 function get_admin_page_parent() { 692 global $parent_file; 693 global $submenu; 694 global $pagenow; 695 global $plugin_page; 696 697 if (isset($parent_file) && ! empty($parent_file)) { 698 return $parent_file; 699 } 700 701 foreach (array_keys($submenu) as $parent) { 702 foreach ($submenu[$parent] as $submenu_array) { 703 if ($submenu_array[2] == $pagenow) { 704 $parent_file = $parent; 705 return $parent; 706 } else if (isset($plugin_page) && ($plugin_page == $submenu_array[2])) { 707 $parent_file = $parent; 708 return $parent; 709 } 710 } 711 } 712 713 $parent_file = ''; 714 return ''; 715 } 716 717 function add_options_page($page_title, $menu_title, $access_level, $file) { 718 global $submenu; 719 720 $file = basename($file); 721 722 $submenu['options-general.php'][] = array($menu_title, $access_level, $file, $page_title); 668 723 } 669 724
Note: See TracChangeset
for help on using the changeset viewer.