The first menu item typically is the parent item and shares the name with that item, you can however manually update the entry directly in the $submenu
variable, like so..
add_action( 'admin_menu', 'jp_create_admin_pages' );
function jp_create_admin_pages() {
global $submenu;
add_menu_page('Members','Members','manage_options','members','jp_handle_admin_members');
add_submenu_page('members','Membership Types','Membership Types','manage_options','membership_types','jp_handle_admin_membership_types');
$submenu['members'][0][0] = 'All Members';
}
That way your parent keeps the original name, whilst the first subitem has another.
Hope that helps.
Related Posts:
- Remove Customize Background and Header from Appearance admin menu without CSS or JS
- renaming an admin menu item with decimal array index number
- Pagination in plugin’s backend
- add menu page in loop menu order
- Remove update nags for non-admins [duplicate]
- How to fix the admin menu margin-top bug in WordPress 5.5?
- Any guides on creating custom admin pages?
- Jquery no more loading, load-scripts.php not found (404)
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- How do I remove a require_once admin panel from the parent theme from the child theme functions.php?
- Handling error states with admin_post
- Installing wp3.2.1 on IIS; getting empty sessions
- Adding Field to Profile “Name”
- How to prevent parent admin page from appearring as a child admin page
- Add a Custom Class to Admin Menus
- How to Add a Link to the Drop-Down User Menu in the Admin Bar?
- When is is_admin() available?
- Creating a new page and automatically associating it with a template in WordPress
- Unable to set right time in admin and frontend template
- List User order by ID in Descending order (Backend)
- Hiding Admin Page While Keeping Menu Expanded
- Create Logout Link WordPress Admin Menu
- Why is this Ajax not working?
- Associating custom submenu item with post type of top level menu item
- Admin Options page. Save as Array
- Why use the Settings API over a new administration menu?
- WooCommerce – Email admin with new user details
- Adding subdomain to home_url for “add_menu_page”
- Correct folder permissions?
- Selectbox in admin panel function linking to CSS
- Sort custom meta column by other meta value
- Add_menu_page not displaying the menu in class based plugin
- running wp-cron.php using php not wget
- Programmatically create page when saving custom post type post
- Add a page in admin without adding menu item
- Building a WordPress App
- Custom plugin settings link doesn’t append current class to menu item when visited? Why?
- How can I open up my administrative panel to everyone?
- Change order of custom submenu link in WP Admin?
- retain querystring values when savincustom options in admin
- Get categories names as an array to use it in theme settings
- Get Page ID from Backend
- how to save checkbox data for custom setting?
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- Admin submenu issue with PHP not detecting two strings as equal
- admin-ajax GET response bad request
- Some menu items wont budge
- Removing custom sort order from admin page listing
- I installed WordPress locally now how do I login?
- Add logo to admin menu in my plugin
- Remove submenu item from list
- Admin Menu new tab external link
- Adding a ‘style=’ bit to image_send_to_editor output
- Get options from database using php class
- Limit ‘contributers’ abilities in WordPress
- In PHP how do I make my navigation bar show certain links to admins only?
- Woocommerce display orders with products from specific categories to specific admins
- PHP warning – Use of undefined constant ‘FORCE_SSL_LOGIN’ ‘FORCE_SSL_ADMIN’ on wp-config.php
- admin panel – How to remove “delete” button from category editing page
- wordpress email checker on domain
- problem connecting to the administrator
- How to add a DELETE button to the “Edit User” WordPress admin page?
- Highlight active Admin Menu when added though add_menu_page
- Editing the term_order field
- Access to “My Site” is missing from the admin bar
- Create WordPress Menu Item Without Linking to a Custom Page
- Add Admin Option w/ Anonymous Function
- Issue with search form admin panel after PHP migration
- wordpress ajax return 0
- Dynamic form variables for post meta
- WP Admin Bar – Get current theme name as custom menu title
- admin menu naming
- How to call a certain object/menubar in a PHP file
- Include administrator in author list
- Shortcodes (with a space) added to php Sample
- Image not displayed
- Adding Media button to only pages
- Forbid certain users to access a specific page
- One folder to be accessible by one user
- Exclude Everywhere but Admin Area?
- AJAX WP_Query’s order and orderby parameters not working
- Add Woocommerce Customers link to custom admin menu
- Is there a built in function to see if a URLis oEmbed Compatible?
- How does this WordPress Plugin (Thrive Comments) apply their custom comment sort? [closed]
- Output ACF repeater on frontend user’s profile page (created with Ultimate Member) [closed]
- Woocommerce Show Single Product on Homepage
- persist a variable set in header.php all the way down to footer.php
- How to Update post_modified of all wordpress post
- Create special button on WP Tiny MCE Posts Editor for Shortcodes
- Obfuscate links (for SEO purpose) [closed]
- Header is not displaying on certain pages of wordpress theme [closed]
- How to access specific product id on other pages/posts?
- Hook into all password resets in WordPress and get password before hashing?
- WordPress select query issue
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Querying multiple meta_keys in WordPress SQL query
- Losing Session ID and sessionStorage when navigating to other domains on Multisite
- There’s a 0 adding to the value on multiple post type
- How can I improve and optimise my wordpress web server for better performance in 2023