You’d need to create the top-level menu page, and then the sub-menu after that.
Here’s an example:
function my_menu() {
add_menu_page (
'MVC Events', // $page_title
'MVC Events', // $menu_title
'manage_options', // $capability
'mvc-events', // $menu_slug
'mvc-options' // $function
);
add_submenu_page (
'mvc-events', // $parent_slug
'ATB Event Options', // $page_title
'ATB Event Options', // $menu_title
'manage_options', // $capability
'atb-event-options', // $menu_slug
'atb-options' // $function
);
}
add_action( 'admin_menu', 'my_menu' );
Here’s the pertinent WP codex file, and one particularly on sub-menus.
Related Posts:
- add function to saving change on Options Pages
- Why WP_Screeen doesn’t show all options with admin_body_class
- Plugin option for input box validation
- How to add field for new site-wide option on Network Settings screen?
- Correct way to serialize the data of options table?
- Admin menu as submenu from another plugin
- Where should I use get_option in a plugin
- Inherit plugin settings to new site in Multisite
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- How to tell if plugin has been network activated
- Delete option doesn’t appear for plugins
- Adding an admin page – OOP approach not working
- Custom plugin settings: clicking “save changes” does not display success message
- Generate Advanced Custom Fields box in custom admin menu page
- Duplicate settings of master blog to slave blogs in WP multi-site installation
- Environment Specific Options Token
- Plugin development: how to create a form and get custom data?
- How do I extract the Alt Text from an image attachment upload via the WordPress Options Framework Plugin?
- How to create a Page alias in WordPress
- How to fetch serialized data from wordpress options
- Some Plugin Settings Are Kept After Removal and Reinstall of the Plugin
- While Using Static Pages, How Can I Get /blog into the URL of Each Post?
- Get all options saved by another plugin
- Removing WordPress Plugin Menu Item for a specific user
- Is it ok to call get_option without hooks?
- Enable/Disable WP options programmatically
- Settings API – input always updates over validation
- clean wp_options table unused rows
- How to set CORS header?
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- How do I remove the entire left nav bar in admin for certain level users?
- Restore a Plugin’s Default Settings
- Creating a plugin that will add options. Where should the options menu pages go?
- update_user_meta add value on the top on existing value
- Set the active Navigation Menu from a plugin
- how can I link to a PlugIn admin-sub-menu page after processing a formular
- Serialize data for wp options
- Why slash is removed after domain?
- How to add a default value to get_option if it’s used as a variable?
- Make menu page link inaccessible or disabled
- WordPress get_option and update_option returned entered on the textbox field
- Get plugin option in another PHP file
- Creating a nav menu
- How to remove traces from widget during uninstallation
- Polylang : Interverting languages after development [closed]
- php page not found for plugin options menu
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- Suggestions on Approach to New Plugin I’m Stuck On
- options creation for plugins
- get_option error plugin development
- What’s causing this error? “Warning: Invalid argument”
- WordPress error: Options page Setting_ not found in the allowed options list
- update_option_{$option} not showing old value
- WordPress Admin Menu defining function is seperate file
- Allowed memory size exhausted problem
- Plugin getting Cannot modify header information errors
- Saving widget options from class method
- OceanWP settings are missing from Add New Post [closed]
- Plugin – Admin menu page broken url
- Plugin scheduled event not working
- Update WP option by plugin
- Store plugin page content in wp_options?
- Add logo to admin menu in my plugin
- How to make a textarea accept javascript in my settings apge?
- Custom page in plugin visible in menu
- Need to add/remove group of options and display them as rows
- Settings options not showing up on Sub Menu page in WordPress plugin
- How to get values from network settings panel?
- How to add a custom form to a plugin’s setting page
- update_option creates an option, which empties on a blog reload
- Using call_user_func() within add_settings_section() within a Class
- How to make sure settings are not lost when plugin is updated?
- Save log for imports in WordPress database – options-table, custom post type or other place?
- how to show new field if option selected?
- Creating an array from form inputs before it is posted to the options database
- Changing the CSS with a plugin
- Optimized PHP & WordPress settings for speed/performance?
- Horizontlal scrolling content
- Enable plugins that are “not supported”
- Admin Custom Login loses settings on Code and Data migration
- Why is the WordPress update_option not working in this code?
- WordPress update plugin through Dashboard/Plugins displaying error
- How to create a new database table whenever user changes options
- get_option return incorrect values
- Option page not updating multiple records in settings api
- get_option returning old value for non-admin users
- Error when renaming option
- Validating values using Settings API?
- Getting 404 page not found error while trying to access add new plugin / themes
- Plugin menu replaced by another plugin?
- how to protect wordpress website
- homepage olderposts link showing page not found
- WP e-commerce sales-view
- My first plugin doesn’t save the data in options
- How to programmatically detect how many posts are displayed per page?
- Plugin link does not appear in my toolbar
- selecting options from another form
- How to access values from your own settings page in javascript?
- admin_enqueue_scripts using hook_suffix vs GET page
- Submitting form to admin-post.php WordPress