add_menu_page permissions – what am I doing wrong?

You want the admin_menu hook, rather than admin_init.

Also, you shouldn’t use anonymous functions. Instead, use:

function wpse51004_add_menu_page() {
    add_menu_page('Some Page', 'Some Page', 'manage_options', 'some-slug', 'wpse51004_some_page_callback');
};
add_action('admin_menu', 'wpse51004_add_menu_page');

function wpse51004_some_page_callback() {
        echo 'Hello, world!';
    }

Leave a Comment