I’m trying add menu page in multisite (settings will be global for all blogs).

Current code created in plugin and activated in network

function wpdocs_register_my_custom_menu_page() {
    add_menu_page(
        __( 'Custom Menu Title', 'textdomain' ),
        'custom menu',
        'manage_options',
        'myplugin/myplugin-admin.php',
        '');
}
add_action( 'admin_menu', 'wpdocs_register_my_custom_menu_page' );

But it show only in blog menu, I think should be different action hook, maybe someone can help me ?

1 Answer
1

I believe you’re looking for the network_admin_menu hook.

Here’s how you’d use it:

add_action('network_admin_menu', 'function_name');
function function_name() {
    add_menu_page( 
        "page_title", 
        "menu_title", 
        'capability', 
        'menu_slug', 
        'function_callback' 
    );  
} 

Leave a Reply

Your email address will not be published. Required fields are marked *