Changeset 15753
- Timestamp:
- 10/07/2010 10:35:31 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/plugin.php
r15744 r15753 853 853 * Add a top level menu page in the 'objects' section 854 854 * 855 * This function takes a capability which will be used to determine whether856 * or not a page is included in the menu.857 *858 * The function which is hooked in to handle the output of the page must check859 * that the user has the required capability as well.860 *861 855 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 862 856 * @param string $menu_title The text to be used for the menu … … 877 871 * Add a top level menu page in the 'utility' section 878 872 * 879 * This function takes a capability which will be used to determine whether880 * or not a page is included in the menu.881 *882 * The function which is hooked in to handle the output of the page must check883 * that the user has the required capability as well.884 *885 873 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 886 874 * @param string $menu_title The text to be used for the menu … … 900 888 /** 901 889 * Add a sub menu page 902 *903 * This function takes a capability which will be used to determine whether904 * or not a page is included in the menu.905 *906 * The function which is hooked in to handle the output of the page must check907 * that the user has the required capability as well.908 890 * 909 891 * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page) … … 963 945 /** 964 946 * Add sub menu page to the tools main menu. 965 *966 * This function takes a capability which will be used to determine whether967 * or not a page is included in the menu.968 *969 * The function which is hooked in to handle the output of the page must check970 * that the user has the required capability as well.971 947 * 972 948 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 982 958 /** 983 959 * Add sub menu page to the options main menu. 984 *985 * This function takes a capability which will be used to determine whether986 * or not a page is included in the menu.987 *988 * The function which is hooked in to handle the output of the page must check989 * that the user has the required capability as well.990 960 * 991 961 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1001 971 /** 1002 972 * Add sub menu page to the themes main menu. 1003 *1004 * This function takes a capability which will be used to determine whether1005 * or not a page is included in the menu.1006 *1007 * The function which is hooked in to handle the output of the page must check1008 * that the user has the required capability as well.1009 973 * 1010 974 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1020 984 /** 1021 985 * Add sub menu page to the plugins main menu. 1022 *1023 * This function takes a capability which will be used to determine whether1024 * or not a page is included in the menu.1025 *1026 * The function which is hooked in to handle the output of the page must check1027 * that the user has the required capability as well.1028 986 * 1029 987 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1039 997 /** 1040 998 * Add sub menu page to the Users/Profile main menu. 1041 *1042 * This function takes a capability which will be used to determine whether1043 * or not a page is included in the menu.1044 *1045 * The function which is hooked in to handle the output of the page must check1046 * that the user has the required capability as well.1047 999 * 1048 1000 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1061 1013 /** 1062 1014 * Add sub menu page to the Dashboard main menu. 1063 *1064 * This function takes a capability which will be used to determine whether1065 * or not a page is included in the menu.1066 *1067 * The function which is hooked in to handle the output of the page must check1068 * that the user has the required capability as well.1069 1015 * 1070 1016 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1080 1026 /** 1081 1027 * Add sub menu page to the posts main menu. 1082 *1083 * This function takes a capability which will be used to determine whether1084 * or not a page is included in the menu.1085 *1086 * The function which is hooked in to handle the output of the page must check1087 * that the user has the required capability as well.1088 1028 * 1089 1029 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1099 1039 /** 1100 1040 * Add sub menu page to the media main menu. 1101 *1102 * This function takes a capability which will be used to determine whether1103 * or not a page is included in the menu.1104 *1105 * The function which is hooked in to handle the output of the page must check1106 * that the user has the required capability as well.1107 1041 * 1108 1042 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1118 1052 /** 1119 1053 * Add sub menu page to the links main menu. 1120 *1121 * This function takes a capability which will be used to determine whether1122 * or not a page is included in the menu.1123 *1124 * The function which is hooked in to handle the output of the page must check1125 * that the user has the required capability as well.1126 1054 * 1127 1055 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1137 1065 /** 1138 1066 * Add sub menu page to the pages main menu. 1139 *1140 * This function takes a capability which will be used to determine whether1141 * or not a page is included in the menu.1142 *1143 * The function which is hooked in to handle the output of the page must check1144 * that the user has the required capability as well.1145 1067 * 1146 1068 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1156 1078 /** 1157 1079 * Add sub menu page to the comments main menu. 1158 *1159 * This function takes a capability which will be used to determine whether1160 * or not a page is included in the menu.1161 *1162 * The function which is hooked in to handle the output of the page must check1163 * that the user has the required capability as well.1164 1080 * 1165 1081 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected … … 1171 1087 function add_comments_page( $page_title, $menu_title, $capability, $menu_slug, $function = '' ) { 1172 1088 return add_submenu_page( 'edit-comments.php', $page_title, $menu_title, $capability, $menu_slug, $function ); 1089 } 1090 1091 1092 /** 1093 * Remove a top level admin menu 1094 * 1095 * @since 3.1.0 1096 * 1097 * @param string $menu_slug The slug of the menu 1098 * @return array|bool The removed menu on success, False if not found 1099 */ 1100 function remove_menu_page( $menu_slug ) { 1101 global $menu; 1102 1103 foreach ( $menu as $i => $item ) { 1104 if ( $menu_slug == $item[2] ) { 1105 unset( $menu[$i] ); 1106 return $item; 1107 } 1108 } 1109 1110 return false; 1111 } 1112 1113 /** 1114 * Remove an admin submenu 1115 * 1116 * @since 3.1.0 1117 * 1118 * @param string $menu_slug The slug for the parent menu 1119 * @param string $submenu_slug The slug of the submenu 1120 * @return array|bool The removed submenu on success, False if not found 1121 */ 1122 function remove_submenu_page( $menu_slug, $submenu_slug ) { 1123 global $submenu; 1124 1125 if ( !isset( $submenu[$menu_slug] ) ) 1126 return false; 1127 1128 foreach ( $submenu[$menu_slug] as $i => $item ) { 1129 if ( $submenu_slug == $item[2] ) { 1130 unset( $submenu[$menu_slug][$i] ); 1131 return $item; 1132 } 1133 } 1134 1135 return false; 1173 1136 } 1174 1137
Note: See TracChangeset
for help on using the changeset viewer.