Created
September 26, 2018 16:36
-
-
Save sabbir1991/91251b07f227febafa945d0cfe0abac2 to your computer and use it in GitHub Desktop.
Menu under sub menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( 'admin_menu', 'prefix_admin_menu' ); | |
| function prefix_admin_menu() { | |
| global $submenu; | |
| add_menu_page( __( 'Project Manager', 'text-domain' ), __( 'Project Manager', 'text-domain' ), 'manage_options', 'awesome-pm', 'pm_dashboard_cb' ); | |
| $submenu[ 'awesome-pm' ][] = array( __( 'Project', 'text-domain' ), 'manage_options', 'admin.php?page=awesome-pm#/' ); | |
| $submenu[ 'awesome-pm' ][] = array( __( 'Message', 'text-domain' ), 'manage_options', 'admin.php?page=awesome-pm#/message' ); | |
| $submenu[ 'awesome-pm' ][] = array( __( 'Settings', 'text-domain' ), 'manage_options', 'admin.php?page=awesome-pm#/settings' ); | |
| } | |
| // For line number 8 callback function. where main single page div loaded | |
| function pm_dashboard_cb() { | |
| ?> | |
| <div class="wrap"> | |
| <div id="vue-app"><div> | |
| </div> | |
| <?php | |
| } | |
| =============================================================== | |
| Output will be: | |
| Project Manager ----> Main menu : cause line no- 8 | |
| - Project ---> Sub menu: cause line no- 10 | |
| - Message ---> Sub menu: cause line no- 11 | |
| - Settings -----> Sub menu: cause line no- 12 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment