我在这里做了一些研究,似乎我太努力了。我找到了以下解决方案。这个的道具answer.
// Create admin page navigation listings
function bf_carrier_admin_network() {
$hook_suffix = add_submenu_page(\'settings.php\', \'Carriers\', \'BrightFire Carriers\', \'edit_posts\', \'ins-carrier-edit\', \'carrier_admin_network\');
add_action( "load-{$hook_suffix}", \'bfc_styles_scripts\' );
}
add_action(\'network_admin_menu\', \'bf_carrier_admin_network\');
function bf_carrier_admin_display() {
if (current_user_can(\'manage_options\')){
$hook_suffix = add_options_page(\'BrightFire Carriers\', \'BrightFire Carriers\', \'edit_posts\', \'ins-carrier-display\', \'carrier_admin\');
}else{
$hook_suffix = add_menu_page(\'Carriers\', \'Carriers\', \'edit_posts\', \'ins-carrier-display\', \'carrier_admin\',\'dashicons-products\',58);
}
add_action( "load-{$hook_suffix}", \'bfc_styles_scripts\' );
}
add_action(\'admin_menu\', \'bf_carrier_admin_display\');
//register admin scripts
function bfc_styles_scripts(){
wp_enqueue_script(\'jquery\');
wp_enqueue_script(\'jquery-effects-core\');
wp_enqueue_script(\'jquery-effects-drop\');
wp_enqueue_script(\'jquery-effects-highlight\');
wp_enqueue_style( \'bfc_admin_style\', plugins_url( \'css/admin.css\' , __FILE__ ));
wp_enqueue_script(\'bootstrap\', plugins_url(\'js/bootstrap.js\', __FILE__), array(\'jquery\'), \'2.3.2\');
}