I have checked your code. You are using incorrect menu-slug in add_submenu_page. Because admin already has page query var which conflicts with your menu slug page=settings&submenu=page2.
I have updated the code.
add_menu_page( 'Main Menu', 'Main Menu Titlw', $min_access_cap, 'main-main', array($this, 'main_menu'), $icon_url, 999 );
add_submenu_page( 'main-menu', sprintf( __( '%1$s ‹ %2$s', 'main-menu' ), $title['page_title'], 'Submenu' ), $title['admin_menu_title'], $min_access_cap, 'submenu/slug', array($this, 'sub_menu') );
Related Posts:
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- Admin menu as submenu from another plugin
- Creating a WordPress admin page without a menu for a plugin
- Removing an admin page added by a 3rd party plugin. Gravity forms in this example
- Delete option doesn’t appear for plugins
- Adding an admin page – OOP approach not working
- Generate Advanced Custom Fields box in custom admin menu page
- Plugin development: how to create a form and get custom data?
- Master menu item for multiple plugins?
- How to make a WP admin button/menu similar to Jetpack Notifications?
- wp_verify_nonce() why return false?
- Detecting when a custom taxonomy has been changed and display alert?
- Removing WordPress Plugin Menu Item for a specific user
- add function to saving change on Options Pages
- Change the $parent_file of a plugin page
- reorder plugin menu position
- How do I remove the entire left nav bar in admin for certain level users?
- Hide Theme options and Customize Admin menu
- How to send little data between admin pages of my plugin?
- how can I link to a PlugIn admin-sub-menu page after processing a formular
- White page on custom plugin option submit
- Make menu page link inaccessible or disabled
- Show existing POST categories as items in the sidebar menu [closed]
- Polylang : Interverting languages after development [closed]
- Suggestions on Approach to New Plugin I’m Stuck On
- Dynamic admin submenu
- WP Plugins – Use includes to display page content
- Add menu page issues (permissions & position)
- How to use add_submenu_page() for editors?
- What’s causing this error? “Warning: Invalid argument”
- Move plugin-settings to ‘Settings’-menu in the admin
- Editing a text file from plugin menu
- WordPress Admin Menu defining function is seperate file
- creating a plug in that would tap into save/update action of posts [closed]
- Display Plugin Panels Outside of Admin Areas
- Why WP_Screeen doesn’t show all options with admin_body_class
- Plugin Admin Menu Boiler Plate
- add_submenu_page returns null
- Plugin – Admin menu page broken url
- How do I add an options page at the bottom of the list?
- How to remove a CPT Menu from the Root Admin only
- Show WordPress Plugin Menu(Admin) To Editor
- Add logo to admin menu in my plugin
- How do you add a settings page to another menu?
- Custom page in plugin visible in menu
- Adding custom Field To The Posts Listing
- Creating an admin button that when clicked shows a popup form
- add menu page not showing Icon
- Custom Icon assigned to menu items not working for multi-site networks
- Admin menu hilighting wrong item for CPT
- Creating Admin Submenu Page via Class Method
- Plugin option for input box validation
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Assigning a custom post type to a custom page
- How can I pass value to function in add_menu_page?
- Getting 404 page not found error while trying to access add new plugin / themes
- Plugin menu replaced by another plugin?
- Plugin link does not appear in my toolbar
- admin_enqueue_scripts using hook_suffix vs GET page
- Submitting form to admin-post.php WordPress
- How to embed .mp4 videos in a WordPress post?
- Detailed form plugin, with ability to export to excel etc. OR edit PDF live? [closed]
- How to remove js ui library added by default by wordpress
- What is the best way to cache pages on WordPress
- Stop wordpress from requesting external jquery from googleapi
- how do i change my website facebook login button to another text immediately user login? [closed]
- “Deregister” plugin from frontend or specific pages?
- Action on WordPress Install
- Some images on WordPress site are suddenly gone
- What is the best way to make a custom page from a plugin?
- Setting text widget to one page only
- How to add captcha to publish widget
- Permalinks and pagination are not working in WordPress with WP e-Commerce plugin
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- How to add logo to a WordPress Custom Plugin?
- Using OR Condition with facetwp facets
- insert og image link in wordpress post
- Is it possible to place a WordPress widget into the main page layout?
- Plugin updated pushed with git break site
- Forbidden 403 Access to this resource on the server is denied
- Error on plugin activation and creating new page
- Showing different js file for different theme in wordpress customizer api
- how to make settings page for woocommerce plugin?
- what’s different between wpdb->prefix and table_prefix
- User Following System
- Top authors or top categories by post views?
- Can Hosting affect a plugin from working properly?
- WP default file upload hook not working if used in a plugin
- Need help getting a certain value out of a multi dimensional array
- Plugin’s required JS not being inserted in my theme
- WordPress internationalization + domains
- Display alt text as tool tip on page
- Gravity Forms Salesforce field mapping for custom objects
- Plugin:Read More Right Here , How to change the name (more…) to Read More
- How do I output user_registered time in my correct timezone?
- Ajax in Plugins: returns the whole page
- How to change prices per number ordered in WooCommerce [closed]
- Oxygen plugin wordpress stuck in loading sequence forever when trying to edit a page [closed]
- plugin doesn’t retrieve data from database
- I want to create a search option for CPT using plugin. The search options should search for categories and tags