You’re very close.
When you add your first submenu page you want to duplicate your initial menu page. In your second add_submenu_page
you are missing the function callback for that page. Technically this parameter is optional, but it changes your url from /wp-admin/sub-menu-page
to /wp-admin/admin.php?page=sub-menu-page
.
Give this a shot:
add_action( 'admin_menu', 'my_menu_pages' );
function my_menu_pages() {
add_menu_page( 'WISE Admin', 'WISE Admin', 'manage_options', 'wise-menu', 'my_menu_output', 'dashicons-tickets', 2 );
add_submenu_page( 'wise-menu', 'General Settings', 'General', 'manage_options', 'wise-menu', 'my_menu_output' );
add_submenu_page( 'wise-menu', 'Submenu Page', 'Submenu Page', 'manage_options', 'sub-menu-page', 'submenu_settings' );
}
Related Posts:
- Passing arguments to a admin menu page callback?
- Admin settings update updating every time home page is hit?
- What’s the best method for emptying an option created with the Settings API?
- What is the recommended way to create plugin administration forms?
- How to add a new plugin page under desired Options page?
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- Overwriting Core WordPress Functions with Plugins
- Naming Admin Menus and Submenus
- Current class on admin menu using add_submenu_page()
- Add Admin Menu Inside Construct or Init
- Hook event for upload image in the menu
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- add_menu_page() with function inside a class [duplicate]
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- How to put placeholder text in the main post input area?
- Unified Approach for Placing Option Pages
- Plugin with specific admin menu icon
- OOP Plugin and Menu – Call to undefined function register_setting()
- Global State During an Admin Post
- Howto: Use Custom Post Types as Submenu Items in Admin
- Sub Menu content is being duplicated
- Set different custom menu items for different user roles
- Show/Hide ‘add new user’ custom fields in wordpress admin panel by click another field
- Bootstrap doesn’t work on admin menu page-How to override wp-admin style?
- is it recommended to use WP_List_Table?
- Creating Admin Plugin – Content of a page is displayed at global scope as well
- Add a page in admin without adding menu item
- Silently register plugin pages
- WordPress theme options Menu
- Print Dashboard submenu name and filename
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- Unable to get a simple plugin admin page to work
- Disable Auto-Expanding Menu in WordPress Admin Menus
- in_array function Problem
- Use options to control jQuery plugin
- Restrict certain actions to plugin-specific admin menu pages only
- Proper way to create an administration page without adding it to the menu
- Pause plugin option page until all data manipulation is complete
- How to add text editor in plugin menu?
- How to make an admin plugin menu page go full screen?
- How to add admin.php to WP Admin Menu Link
- Convert each new line in the textfield as a new value in an array
- How put the correct URL to sub-menu plugin?
- Developing a plugin where users can edit entries saved in database
- Add a description/hint field in the admin page of a plugin
- Forcing ALL plugin Admin menus into a separate menu
- Link to a admin submenu item using a custom link
- Plugin admin list pages as submenu
- Change Admin menu placement using hooks
- Menu_slug used for creating options page
- How to design WooCommerce-like admin tabs for plugin settings page?
- Show Admin Menu
- How can a plugin create a page/form in the front end?
- Looking for WordPress System Diagrams
- How do you create a custom edit.php / edit pages page
- Check the Version of an Enqueue’d External Library
- Edit the output of wp_widget_rss_output()
- How to Parse an Array of Elements in Gutenberg Block
- Custom rewrite rule serves content, but returns 404 error code
- How to edit mySQL wp_posts table from plugin php?
- Creating a Wordpess Plugin that writes data to a csv file. The data doesn’t show in the csv file?
- Using the Settings API, how should I add multiple values to an option?
- WP custom menus error > menu name already exists?
- Remove Internal Style Sheet if no Value Provided?
- Widget update function not saving values
- get_the_excerpt() is not returning an empty string when the_excerpt is blank?
- “Plugin could not be activated because it triggered a fatal error.”
- Storing product price data in the database
- Does the order of sections in readme.txt matter?
- Add column in WP user but it goes wrong
- modify wordpress default search
- Is file_get_contents() the only way for plugins reading local files OR does WP_Filesystem_Direct::get_contents() even work?
- SSL certificate verify failed
- How to load library scripts in admin from plugins in noConflict wrapper?
- wordpress how to query wp_options table
- rest_no_route on custom API endpoint wordpress
- adding wp-cli commands to plugin: how to document to users?
- Additional classes `undefined` after saving post in Gutenberg
- How do you submit a Gutenberg plugin?
- Multiple API Endpoints (wp_remote_get)
- plugin_dir_url & plugin_basename not working when plugin dir is outside wordpress dir
- How to replace default comments with custom HTML?
- WP nonce field checkbox prints checked=’checked’ outside input field
- Creating two tables in database on activation hook
- It is possible to pass $args that sent by add_settings_field() inside another function?
- Change reminder email date to 14 days before
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Adding Amchart Interface to WordPress API
- WordPress Own Rewrite Rules
- Don’t print customizer styles when no setting has been used
- Plugin with functions inside a class & how to trigger WP CRON
- add_settings_error on validating plugin options API
- Unable to show a message after plugin activation
- How to get an array out of a nav menu if it’s a plugin?
- Can I access WordPress API’s from within plugin scripts?
- Is there a way to make is_search() always return false
- Ajax url value to pass ‘variable’ to use in query
- Apply Filters Causing a 500 Internal Server Error
- Reinitiate Gutenburg’s blocks using javascript
- Generating Multiple Divi Pages from Database