I didn’t test this but i’m pretty sure you just need to remove your code from the admin_menu() function declaration.
Like this:
add_action('admin_menu', 'register_my_custom_submenu_page');
function register_my_custom_submenu_page() {
add_submenu_page(
'tools.php',
'Submenu Page',
'My Custom Submenu Page',
'manage_options',
'my-custom-submenu-page',
'my_custom_submenu_page_content' );
}
function my_custom_submenu_page_content() {
?>
<div class="wrap">
<h2>Page Title</h2>
</div>
<?php
}
Related Posts:
- Check if add_menu_page exists or not
- Creating WordPress Plugin solely for Admin panel with dash menu and submenus
- Creating a nav menu
- Howto check version of another plugin and then add a submenu page to it
- How to use add_submenu_page() for editors?
- Use current class method inside add_submenu_page()
- Why WP_Screeen doesn’t show all options with admin_body_class
- $pages = get_pages(‘child_of=’.$post->ID); Why arguments are concatenated?
- Adding submenu to custom plugin menu page created with add_menu_page() function
- WordPress Custom Menu Admin helper plugin
- How do you add a settings page to another menu?
- Settings options not showing up on Sub Menu page in WordPress plugin
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- How to hide plugin submenu title in drop down in admin panel in wordpress?
- How to add styles to a submenu page?
- Admin menu hilighting wrong item for CPT
- Horizontlal scrolling content
- Add subemenu option page
- Redirect loop when forwarding to mobile site
- Ajax Not Working If The Handler is Located Outside Plugin Submenu Page Function
- Multiple plugins settings of same developer into ONE settings page linked together
- Use Notepad++ as HEX-Editor
- Change Page’s Tag Using functions.php File
- Help making my pagination plugin better
- Having Multiple authors for the same WordPress Plugin
- How can a plugin run a script after being updated in MultiSite?
- File Storage Plugin (For Individual Users)?
- Pass A Value From Outside To A Plugin Variable
- Add query string to plugin URL
- How to add a privacy-checkbox in comment-template?
- Can plugin variables cause conflict?
- Events plugin for theater (event = performance of a production)
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- What are the benefit in adding hook in the init() hook?
- Force [wordpress_social_login] shortcode to display where it is embedded [closed]
- How to hide plugin from WordPress Multisite admin plugin list
- Unable to install theme recommended plugins on Multisite
- WordPress URL redirect
- Getting selected (highlighted) html from the Visual Editor on Edit Post page?
- Accidentally Broke Site (Please Help) [closed]
- Apple push notification doesn’t work
- How to query the custom fields by language?
- WordPress Ajax Posting from App
- Is any gallery plugin available to generate galleries from existing uploaded images? [closed]
- How Do I Figure Out What File(s) to Edit from Looking at the Source Code [closed]
- Any recommendation on how to manage ads?
- List taxonomy terms for post as checkboxes
- Change permalinks of custom post type ‘question’ as post id or any random number once
- Conditional attributes and logic per product category
- Why Is This Code Causing The Admin Bar to Disappear?
- WordPress stripping away backslashes from HTML
- How create Group Blogs based on user created Groups
- Displaying Custom Sidebar Without Modifying Theme’s Core File?
- Echo user id of users in seperate table
- How to upload multiple files/images when developing a wordpress plugin?
- plugin code is pulling information from database in one instance and not in other. What is wrong?
- Recommend a flexible lightbox that allows an image or HTML to be used
- How to apply next/previous classes to LIs for pagination links?
- Socialite WP plugin, unable to obtain API keys from FB
- WordPress reliability
- Include a php file from another plugin
- How to create wordpress widget that is fixed position on the home page
- Too many login attempts
- Php page with filters for custom fields
- How can I fetch data from another website to my wordpress website with mysql database
- How to translate WP Blog (search, category etc.)?
- How can I concatenate variables to search results title? [closed]
- Switch from wp-cron to a server cron job
- Sending customer an email with link to stripe to make payment
- How to pass a query string to another page on the same site?
- How can I add a fixed vertical menu to my site? [closed]
- WordPress plugin: efficient way to store large data
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- Sage wordpress add customize register
- Seperate plugin and theme files
- How to make PDF books readable on site with woo-commerce?
- custom post type plugin error [closed]
- get_post_meta shortcode returns empty field
- Does anybody know how to insert a complete jquery plugin into a wordpress elementor-page?
- How to change WordPress core language using Loco Translate?
- Removing Plugin Action via Theme for Non-admins
- Cannot install plugins
- how does a plugin get active in wordpress
- How do I run my custom function in my plugin when a wordpress user is deleted?
- Page Contents showing in Footer Area
- Update (a function) post’s featured image as soon as $image_url changes
- Widget logic using woocommerce product category
- Surviving WordPress and plugin updates
- How to order users alphabetically by name? in plugin UPME
- WordPress Background Audio – Continous AutoPlay
- How to change a specific page to custom page?
- Being notified when some YouTube video in some post becomes unavailable
- How use Dynamic hyperlink on each wordpress post?
- Why do I get this “peer’s certificate issuer not recognised” error when trying to install a theme?
- _e in wordpress +
- How to execute init or woocommerce_init only for checkout page
- how to restore wordpress backup(.rar) manually?
- wordpress jquery is not defined because the head tag is empty
- Questions about using Disqus or Jetpack for comments [closed]
- Any plugin/theme available which suits my requirement? [closed]