Changeset 35731 for trunk/src/wp-admin/includes/plugin.php
- Timestamp:
- 11/23/2015 05:55:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin.php
r35669 r35731 1014 1014 1015 1015 /** 1016 * Add a top level menu page1016 * Add a top-level menu page. 1017 1017 * 1018 1018 * This function takes a capability which will be used to determine whether … … 1027 1027 * @global array $_parent_pages 1028 1028 * 1029 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected1030 * @param string $menu_title The text to be used for the menu1031 * @param string $capability The capability required for this menu to be displayed to the user.1032 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu)1033 * @param callable $function The function to be called to output the content for this page.1034 * @param string $icon_url The urlto the icon to be used for this menu.1035 * * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.1036 * This should begin with 'data:image/svg+xml;base64,'.1037 * * Pass the name of a Dashicons helper class to use a font icon, e.g. 'dashicons-chart-pie'.1038 * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.1039 * @param int $position The position in the menu order this one should appear1040 * 1041 * @return string The resulting page's hook_suffix 1029 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1030 * @param string $menu_title The text to be used for the menu. 1031 * @param string $capability The capability required for this menu to be displayed to the user. 1032 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1033 * @param callable $function The function to be called to output the content for this page. 1034 * @param string $icon_url The URL to the icon to be used for this menu. 1035 * * Pass a base64-encoded SVG using a data URI, which will be colored to match 1036 * the color scheme. This should begin with 'data:image/svg+xml;base64,'. 1037 * * Pass the name of a Dashicons helper class to use a font icon, 1038 * e.g. 'dashicons-chart-pie'. 1039 * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS. 1040 * @param int $position The position in the menu order this one should appear. 1041 * @return string The resulting page's hook_suffix. 1042 1042 */ 1043 1043 function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '', $position = null ) { … … 1081 1081 1082 1082 /** 1083 * Add a top level menu page in the 'objects' section1083 * Add a top-level menu page in the 'objects' section. 1084 1084 * 1085 1085 * This function takes a capability which will be used to determine whether … … 1091 1091 * @global int $_wp_last_object_menu 1092 1092 * 1093 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1094 * @param string $menu_title The text to be used for the menu 1095 * @param string $capability The capability required for this menu to be displayed to the user. 1096 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1097 * @param callable $function The function to be called to output the content for this page. 1098 * @param string $icon_url The url to the icon to be used for this menu 1099 * 1100 * @return string The resulting page's hook_suffix 1093 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1094 * @param string $menu_title The text to be used for the menu. 1095 * @param string $capability The capability required for this menu to be displayed to the user. 1096 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1097 * @param callable $function The function to be called to output the content for this page. 1098 * @param string $icon_url The url to the icon to be used for this menu. 1099 * @return string The resulting page's hook_suffix. 1101 1100 */ 1102 1101 function add_object_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') { … … 1109 1108 1110 1109 /** 1111 * Add a top level menu page in the 'utility' section1110 * Add a top-level menu page in the 'utility' section. 1112 1111 * 1113 1112 * This function takes a capability which will be used to determine whether … … 1119 1118 * @global int $_wp_last_utility_menu 1120 1119 * 1121 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1122 * @param string $menu_title The text to be used for the menu 1123 * @param string $capability The capability required for this menu to be displayed to the user. 1124 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1125 * @param callable $function The function to be called to output the content for this page. 1126 * @param string $icon_url The url to the icon to be used for this menu 1127 * 1128 * @return string The resulting page's hook_suffix 1120 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1121 * @param string $menu_title The text to be used for the menu. 1122 * @param string $capability The capability required for this menu to be displayed to the user. 1123 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1124 * @param callable $function The function to be called to output the content for this page. 1125 * @param string $icon_url The url to the icon to be used for this menu. 1126 * @return string The resulting page's hook_suffix. 1129 1127 */ 1130 1128 function add_utility_page( $page_title, $menu_title, $capability, $menu_slug, $function = '', $icon_url = '') { … … 1137 1135 1138 1136 /** 1139 * Add a sub menu page1137 * Add a submenu page. 1140 1138 * 1141 1139 * This function takes a capability which will be used to determine whether … … 1148 1146 * @global array $menu 1149 1147 * @global array $_wp_real_parent_file 1150 * @global bool $_wp_submenu_nopriv1148 * @global bool $_wp_submenu_nopriv 1151 1149 * @global array $_registered_pages 1152 1150 * @global array $_parent_pages 1153 1151 * 1154 * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page) 1155 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1156 * @param string $menu_title The text to be used for the menu 1157 * @param string $capability The capability required for this menu to be displayed to the user. 1158 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1159 * @param callable $function The function to be called to output the content for this page. 1160 * 1152 * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page). 1153 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1154 * @param string $menu_title The text to be used for the menu. 1155 * @param string $capability The capability required for this menu to be displayed to the user. 1156 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1157 * @param callable $function The function to be called to output the content for this page. 1161 1158 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1162 1159 */ … … 1211 1208 1212 1209 /** 1213 * Add sub 1210 * Add submenu page to the Tools main menu. 1214 1211 * 1215 1212 * This function takes a capability which will be used to determine whether … … 1219 1216 * that the user has the required capability as well. 1220 1217 * 1221 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1222 * @param string $menu_title The text to be used for the menu 1223 * @param string $capability The capability required for this menu to be displayed to the user. 1224 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1225 * @param callable $function The function to be called to output the content for this page. 1226 * 1218 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1219 * @param string $menu_title The text to be used for the menu. 1220 * @param string $capability The capability required for this menu to be displayed to the user. 1221 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1222 * @param callable $function The function to be called to output the content for this page. 1227 1223 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1228 1224 */ … … 1232 1228 1233 1229 /** 1234 * Add sub 1230 * Add submenu page to the Settings main menu. 1235 1231 * 1236 1232 * This function takes a capability which will be used to determine whether … … 1240 1236 * that the user has the required capability as well. 1241 1237 * 1242 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1243 * @param string $menu_title The text to be used for the menu 1244 * @param string $capability The capability required for this menu to be displayed to the user. 1245 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1246 * @param callable $function The function to be called to output the content for this page. 1247 * 1238 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1239 * @param string $menu_title The text to be used for the menu. 1240 * @param string $capability The capability required for this menu to be displayed to the user. 1241 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1242 * @param callable $function The function to be called to output the content for this page. 1248 1243 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1249 1244 */ … … 1253 1248 1254 1249 /** 1255 * Add sub 1250 * Add submenu page to the Appearance main menu. 1256 1251 * 1257 1252 * This function takes a capability which will be used to determine whether … … 1261 1256 * that the user has the required capability as well. 1262 1257 * 1263 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1264 * @param string $menu_title The text to be used for the menu 1265 * @param string $capability The capability required for this menu to be displayed to the user. 1266 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1267 * @param callable $function The function to be called to output the content for this page. 1268 * 1258 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1259 * @param string $menu_title The text to be used for the menu. 1260 * @param string $capability The capability required for this menu to be displayed to the user. 1261 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1262 * @param callable $function The function to be called to output the content for this page. 1269 1263 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1270 1264 */ … … 1274 1268 1275 1269 /** 1276 * Add sub 1270 * Add submenu page to the Plugins main menu. 1277 1271 * 1278 1272 * This function takes a capability which will be used to determine whether … … 1282 1276 * that the user has the required capability as well. 1283 1277 * 1284 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1285 * @param string $menu_title The text to be used for the menu 1286 * @param string $capability The capability required for this menu to be displayed to the user. 1287 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1288 * @param callable $function The function to be called to output the content for this page. 1289 * 1278 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1279 * @param string $menu_title The text to be used for the menu. 1280 * @param string $capability The capability required for this menu to be displayed to the user. 1281 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1282 * @param callable $function The function to be called to output the content for this page. 1290 1283 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1291 1284 */ … … 1295 1288 1296 1289 /** 1297 * Add sub 1290 * Add submenu page to the Users/Profile main menu. 1298 1291 * 1299 1292 * This function takes a capability which will be used to determine whether … … 1303 1296 * that the user has the required capability as well. 1304 1297 * 1305 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1306 * @param string $menu_title The text to be used for the menu 1307 * @param string $capability The capability required for this menu to be displayed to the user. 1308 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1309 * @param callable $function The function to be called to output the content for this page. 1310 * 1298 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1299 * @param string $menu_title The text to be used for the menu. 1300 * @param string $capability The capability required for this menu to be displayed to the user. 1301 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1302 * @param callable $function The function to be called to output the content for this page. 1311 1303 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1312 1304 */ … … 1319 1311 } 1320 1312 /** 1321 * Add sub 1313 * Add submenu page to the Dashboard main menu. 1322 1314 * 1323 1315 * This function takes a capability which will be used to determine whether … … 1327 1319 * that the user has the required capability as well. 1328 1320 * 1329 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1330 * @param string $menu_title The text to be used for the menu 1331 * @param string $capability The capability required for this menu to be displayed to the user. 1332 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1333 * @param callable $function The function to be called to output the content for this page. 1334 * 1321 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1322 * @param string $menu_title The text to be used for the menu. 1323 * @param string $capability The capability required for this menu to be displayed to the user. 1324 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1325 * @param callable $function The function to be called to output the content for this page. 1335 1326 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1336 1327 */ … … 1340 1331 1341 1332 /** 1342 * Add sub 1333 * Add submenu page to the Posts main menu. 1343 1334 * 1344 1335 * This function takes a capability which will be used to determine whether … … 1348 1339 * that the user has the required capability as well. 1349 1340 * 1350 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1351 * @param string $menu_title The text to be used for the menu 1352 * @param string $capability The capability required for this menu to be displayed to the user. 1353 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1354 * @param callable $function The function to be called to output the content for this page. 1355 * 1341 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1342 * @param string $menu_title The text to be used for the menu. 1343 * @param string $capability The capability required for this menu to be displayed to the user. 1344 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1345 * @param callable $function The function to be called to output the content for this page. 1356 1346 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1357 1347 */ … … 1361 1351 1362 1352 /** 1363 * Add sub 1353 * Add submenu page to the Media main menu. 1364 1354 * 1365 1355 * This function takes a capability which will be used to determine whether … … 1369 1359 * that the user has the required capability as well. 1370 1360 * 1371 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1372 * @param string $menu_title The text to be used for the menu 1373 * @param string $capability The capability required for this menu to be displayed to the user. 1374 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1375 * @param callable $function The function to be called to output the content for this page. 1376 * 1361 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1362 * @param string $menu_title The text to be used for the menu. 1363 * @param string $capability The capability required for this menu to be displayed to the user. 1364 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1365 * @param callable $function The function to be called to output the content for this page. 1377 1366 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1378 1367 */ … … 1382 1371 1383 1372 /** 1384 * Add sub 1373 * Add submenu page to the Links main menu. 1385 1374 * 1386 1375 * This function takes a capability which will be used to determine whether … … 1390 1379 * that the user has the required capability as well. 1391 1380 * 1392 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1393 * @param string $menu_title The text to be used for the menu 1394 * @param string $capability The capability required for this menu to be displayed to the user. 1395 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1396 * @param callable $function The function to be called to output the content for this page. 1397 * 1381 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1382 * @param string $menu_title The text to be used for the menu. 1383 * @param string $capability The capability required for this menu to be displayed to the user. 1384 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1385 * @param callable $function The function to be called to output the content for this page. 1398 1386 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1399 1387 */ … … 1403 1391 1404 1392 /** 1405 * Add sub 1393 * Add submenu page to the Pages main menu. 1406 1394 * 1407 1395 * This function takes a capability which will be used to determine whether … … 1411 1399 * that the user has the required capability as well. 1412 1400 * 1413 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1414 * @param string $menu_title The text to be used for the menu 1415 * @param string $capability The capability required for this menu to be displayed to the user. 1416 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1417 * @param callable $function The function to be called to output the content for this page. 1418 * 1401 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1402 * @param string $menu_title The text to be used for the menu. 1403 * @param string $capability The capability required for this menu to be displayed to the user. 1404 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1405 * @param callable $function The function to be called to output the content for this page. 1419 1406 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1420 1407 */ … … 1424 1411 1425 1412 /** 1426 * Add sub 1413 * Add submenu page to the Comments main menu. 1427 1414 * 1428 1415 * This function takes a capability which will be used to determine whether … … 1432 1419 * that the user has the required capability as well. 1433 1420 * 1434 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected 1435 * @param string $menu_title The text to be used for the menu 1436 * @param string $capability The capability required for this menu to be displayed to the user. 1437 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu) 1438 * @param callable $function The function to be called to output the content for this page. 1439 * 1421 * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. 1422 * @param string $menu_title The text to be used for the menu. 1423 * @param string $capability The capability required for this menu to be displayed to the user. 1424 * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). 1425 * @param callable $function The function to be called to output the content for this page. 1440 1426 * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. 1441 1427 */ … … 1445 1431 1446 1432 /** 1447 * Remove a top level admin menu1433 * Remove a top-level admin menu. 1448 1434 * 1449 1435 * @since 3.1.0 … … 1451 1437 * @global array $menu 1452 1438 * 1453 * @param string $menu_slug The slug of the menu 1454 * @return array|bool The removed menu on success, False if not found1439 * @param string $menu_slug The slug of the menu. 1440 * @return array|bool The removed menu on success, false if not found. 1455 1441 */ 1456 1442 function remove_menu_page( $menu_slug ) { … … 1468 1454 1469 1455 /** 1470 * Remove an admin submenu 1456 * Remove an admin submenu. 1471 1457 * 1472 1458 * @since 3.1.0 … … 1474 1460 * @global array $submenu 1475 1461 * 1476 * @param string $menu_slug The slug for the parent menu1477 * @param string $submenu_slug The slug of the submenu 1478 * @return array|bool The removed submenu on success, False if not found1462 * @param string $menu_slug The slug for the parent menu. 1463 * @param string $submenu_slug The slug of the submenu. 1464 * @return array|bool The removed submenu on success, false if not found. 1479 1465 */ 1480 1466 function remove_submenu_page( $menu_slug, $submenu_slug ) {
Note: See TracChangeset
for help on using the changeset viewer.