How to separate sub-menu output and keep associated with parent

Register the navigation menu location in your theme’s functions.php file using the register_nav_menu() function, assign your custom menu to the location in Dashboard > Appearance > Menus, then use the wp_nav_menu() function in your theme’s template files to print the menu’s markup where appropriate. Refer to the overview of Navigation Menus in the Codex.

Adding Meta Box to Specific Submenu Page

I think for this you want to go with WordPress Setting API. If you prefer meta box. You have to add a do_action in your function which render the page (view_tasks_submenu_page_callback). do_action( ‘add_meta_boxes’, $hook_id ); And add do_meta_boxes($hook_id, $context, null) where you want your meta boxes appear. replace $hook_id by the fourth parameter of add_meta_box … Read more

How to keep the plugin submenu open on viewing a custom version of users.php?

You must use a different parent slug (first parameter) to keep the user menu as you want. An example, add_action(‘admin_menu’, ‘register_subscriber_submenu_page’); function wpdocs_register_subscriber_submenu_page() { add_submenu_page( ‘users.php’, ‘Subscribers’, ‘Subscribers’, ‘manage_options’, ‘custom-submenu-page’, ‘custom_callback_function’ ); } Try to prefix your plugin page slug, you can have conflict with such a name : ‘subscribers’ -> your-plugin-subscribers . You will … Read more

Need help finding information to create this type of page

The term you are searching is Get and Set URL params, you can use this to set a param in an URL, like this: add_query_arg( ‘key’, ‘value’, ‘http://example.com’ ); it will return: http://example.com?key=value and to get the value use this: <?php $value_from_URL = get_query_var( ‘key’ ); ?> <h1>My value i just got <?php echo $value_from_URL; … Read more

Role exception for a settings sub menu

You can see here a list of roles and capabilities, if you want to check if the user has a certain role, you can: $the_user = wp_get_current_user();//we get the current user if ( in_array( ‘the_name_of_your_role’, (array) $the_user->roles ) ) { //the user has the rol, add the submenu here } you can use current_user_can if … Read more