对于任何想要添加自己的管理菜单的人;)格式为,
<?php
add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
?>
<?php add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function ); ?>
(摘自wordpress codex)
<?php
defined( \'ABSPATH\' ) or die( \'No script kiddies please!\' );
add_action( \'admin_menu\', \'mgg_aio_menu_creator\' );
function mgg_aio_menu_creator() {
add_menu_page( \'AIO WooCommerce Plugin\', \'AIO\', \'manage_options\', \'aio-dashboard\', \'mgg_aio_dashboard\', plugins_url(\'AIO-WooCommerce-Plugin/ico.png\') , \'81.912514514511451\' );
add_submenu_page( \'aio-dashboard\', \'AIO WooCommerce Plugin\', \'Dashboard\', \'manage_options\', \'aio-dashboard\', \'mgg_aio_dashboard\');
add_submenu_page( \'aio-dashboard\', \'Shipping Options | AIO WooCommerce Plugin\', \'Shipping Options\', \'manage_options\', \'aio-shipping-options\', \'mgg_aio_shipping_options\');
}
require_once \'aio_dashboard.php\';
require_once \'aio_shipping_options.php\';
?>
你会有这样的菜单,