add_menu_page does not seem to work in a class

From add_menu_page in Codex: Note: If you’re running into the “You do not have sufficient permissions to access this page” error, then you’ve hooked too early. The hook you should use is admin_menu. admin_init is too early to hook add_menu_page, use admin_menu.

Associating custom submenu item with post type of top level menu item

You need the information about the current post type in your callback function that renders the submenu page output. And at this point there is a lot of information ready: add_action( ‘admin_menu’, ‘wpse_60730_demo_submenu’ ); /** * Register sub menu pages. * * Note that get_current_screen() is still NULL now. * * @wp-hook admin_menu * @return … Read more