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' // -> To render the page
);
This will hide the sub menu page from your parent (top level) menu link.
It does not state this in the Codex entry for add_submenu_page
though.
It now states this in the Codex entry for add_submenu_page
(thanks goto Ian Dunn).
Related Posts:
- add_menu_page() with different name for first submenu item
- How to add more than 1 user role to sub-menu pages
- Odd behaviour with submenu link creation
- How to avoid creating first submenu page that is same as menu page?
- Sub Menu content is being duplicated
- Is there documentation reference for forms in menu and setting pages?
- Why won’t this submenu page show? – My First WordPress Plugin
- How to create a custom post-new.php page for plugin , no wp menu
- Add a custom submenu under submenu in a Custom WordPress Plugin
- Add Admin menus or submenus depending on conditions
- edit-tags.php in plugin admin menu hides when is the active page
- Adding querystring variable breaks admin URLs
- Is there any plugin development framework
- How do I add CSS options to my plugin without using inline styles?
- How do you store options with a:n:{{}} syntax in wp_options?
- Send user activation email when programmatically creating user
- Saving data-URI to media library
- What is the importance of writing a < WP 3.x compatible plugin nowadays?
- How to create a flexible abstraction for WP_Query?
- How to create and link to administration page for a plugin?
- What is the real intention for admin-post.php?
- Creating custom field with drop down on new post page
- Retrieving custom fields with $wpdb->get_results
- Current class on admin menu using add_submenu_page()
- Add new user and add meta at once
- Problems with removing admin bar
- Handling form request from plugin file
- Timeout on Admin-Ajax?
- Extend plugin options page
- Uploading images from a custom page using blueimp uploader?
- Finding the paragraphs in content
- Create a custom display order in the main menu
- Override the default Add/Edit site forms of the Network Panel in custom plugin
- add more custom post types and custom role to the code
- Proper way to pass credentials in a custom login form to avoid “headers already sent”
- A better way to include localized labels in WordPress plugins
- WordPress Multisite with Azure B2C redirect_urls after Login
- WordPress Block Development – trouble importing from @wordpress/icons
- Clearing caches on plugin uninstall
- plugin settings – uploading multiple files with a single button
- Adding (blog-specific) links to “My Sites” admin page
- Getting term_id for newly created or edited term
- How to enable sorting in custom media uploader in plugin
- How to insert text at the current cursor position in Gutenberg?
- How do I apply a custom discount to individual product total prices depending on their categories on the cart and checkout pages of WooCommerce? [closed]
- How to fix this URL error in WordPress ” data-wplink-url-error=”true”>
- Remove unwanted elements for a wp_nav_menu
- Unit testing a plugin with a theme dependency
- Edit Images From the Front End without Access to WP Admin
- How to remove or add submenu item on plugin activate or deactive
- How do I add a text field under the activity texarea? [closed]
- Help writing custom function with rewrite endpoint that generates a page from dynamic content
- How to make “upgrade safe” theme for a plugin?
- Function/Class to list categories with checkboxes
- Remove an action by extending class and replacing it
- I18n not working in plugin
- making a plugin that moves other plugins wp_head actions to wp_footer
- Is hint for translator compulsory while internationalizing a string containing variables?
- Settings API: Setting default option via ‘get_option’ fails
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- How to redirect to login page when user not loggedin on a particular page
- WP Still Generating 150×150 Thumbnail Size Even After Un-Setting Small Size in Functions.php
- How do I validate extra pin field on my WordPress login form page?
- How to create a wordpress widget that dynamically changes according to the page
- Non editable custom taxonomy
- Plugin to create Posts and Forums then choose category and parent forum
- Checking for existing title in custom db query not working
- Adding Permalink to Slides with ‘Simple Nivo Slider’ plugin?
- How to add a new taxonomy link to the admin menu
- Many Single Sites, One Plugin directory – adjust plugins_url()
- insufficient permissions; coding an action for plugin governed by custom capability
- My plugin creates custom widgets, How can I programatically add them to existing sidebar widget areas?
- Make a php array load faster
- Include external po file for 3th party plugin to theme
- Adding the image selector/uploader to an admin back page
- setTimeout not working in jquery
- How to know if current plugin is going to be used while rendering the page?
- Woocommerce Product finder feature on home page
- How do I show the HTML descrption in wordpress photo gallery for my individual gallery pages?
- Javascript scroll eventHandler only working when I’m logged in in WordPress
- Add language localisation to javascript alert?
- redirect_to how to make it simply work with get parameter or similar?
- cancel place order proccess
- CPT UI and custom database table
- How I can give access to my custom plugin for editor roles user?
- Testing Plugins for Multisite
- Updating a WP Plugin SVN not showing on WordPress Website or Zip
- WP: adding Javascript to specific woo commerce pages
- Calling dynamic_sidebar in plugin gives error
- How to add chunk of php, html, and sql code to variable an append to $content
- Best way to handle a form post in plugin
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- How To Remove The Filter That Adds JetPack Related Content To Dom [closed]
- Fixing plugin for wpdb::prepare
- Remove text from confirmation message
- Can I use an array to create multiple tables?
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- How to get locale within WP REST Request?
- How to add extra EXIF data when images are uploaded?
- How to boost WP custom post REST API GET queries by custom taxonomies