How to link a Custom Post Type submenu to a Nextgen Gallery page?

It would go like this (note the absence of the function parameter – and also the capability instead of a role). add_action( ‘admin_menu’, ‘wpse_74421_menu_admin’ ); function wpse_74421_menu_admin() { add_submenu_page( ‘edit.php?post_type=events’, ‘Add Gallery’, ‘Add Gallery’, ‘delete_plugins’, ‘admin.php?page=nggallery-add-gallery’ ); }

How to create sub menu with a URL parameter?

You’d have to manipulate the global $submenu and modify the link in it. Or use jQuery. The following example adds a submenu in the Dashboard menu and changes the destination link just after. The submenu page will dump the contents of the global var. add_action( ‘admin_menu’, function() { add_submenu_page( ‘index.php’, ‘Sandbox Options’, ‘Options’, ‘administrator’, ‘sandbox_options’, … Read more

add_submenu_page not working

Make sure that your add_action hook is set to admin_menu. Here’s a sample code: add_action(‘admin_menu’, ‘wpse149688’); function wpse149688(){ add_menu_page( ‘Wholesale Pricing’, ‘Wholesale’, ‘manage_options’, ‘woo-wholesale’, ‘woo_wholesale_page_call’); add_submenu_page( ‘woo-wholesale’, ‘Registrations’, ‘Registrations’, ‘manage_options’, ‘woo-wholesale-registrations’, ‘wwpr_page_call’ ); } Also check whether user you’ve logged in as has the ability to view this menu. As this menu is set using … Read more

Add menu and submenu in admin with a URL instead of slug?

This is an old post but can’t you just use wordpress $menu and/or $submenu globals like Oleg suggested in number 2. When in doubt copy WordPress: wordpress/wp-admin/menu.php For example to add link this seems like it would work: function add_external_link_admin_submenu() { global $submenu; $permalink = admin_url( ‘edit-tags.php’ ).’?taxonomy=category’; $submenu[‘options-general.php’][] = array( ‘Manage’, ‘manage_options’, $permalink ); … Read more

Plugin – create a page without it appearing in the side menu

Set the parent_slug property to null, example; add_submenu_page( null // -> Set to null – will hide menu link , ‘Page Title’ // -> Page Title , ‘Menu Title’ // -> Title that would otherwise appear in the menu , ‘administrator’ // -> Capability level , ‘menu_handle’ // -> Still accessible via admin.php?page=menu_handle , ‘page_callback’ … Read more

Add an admin page, but don’t show it on the admin menu

Use a submenu page as parent slug. The admin menu has just two levels, so the imaginary third level will be hidden. Sample code, tested: add_action( ‘admin_menu’, ‘wpse_73622_register_hidden_page’ ); function wpse_73622_register_hidden_page() { add_submenu_page( ‘options-writing.php’, ‘Hidden!’, ‘Hidden!’, ‘exists’, ‘wpse_73622’, ‘wpse_73622_render_hidden_page’ ); # /wp-admin/admin.php?page=wpse_73622 } function wpse_73622_render_hidden_page() { echo ‘<p>hello world</p>’; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)