Skip to content

Instantly share code, notes, and snippets.

@rubel306
Last active May 14, 2018 18:24
Show Gist options
  • Save rubel306/70661265858e9edf1205fbb2e1c957ca to your computer and use it in GitHub Desktop.
Save rubel306/70661265858e9edf1205fbb2e1c957ca to your computer and use it in GitHub Desktop.
//create main menu
function custom_menu(){
add_menu_page(
'firstPugin', //page title
'First Plugin', //menu title
'manage_options', //admin level
'first-pugin', //page slug
'custom_admin_view', //callback function
'dashicons-dashboard', //icon url
11, // menu position
);
// create submneu
add_submenu_page(
'first-plugin', //parent slug
'Add New', //page title
'Add New', //menu title
'manage_options', //capability
'first-plugin', //menu slug
'add_new_function' //callback funtion
);
add_submenu_page(
'first-plugin', //parent slug
'All Pages', //page title
'All Pages', //menu title
'manage_options', //capability
'all-pages', //menu slug
'all_pages' //callback funtion
);
}
add_action('admin_menu', 'custom_menu');
function custom_admin_view(){
echo "This admin view of thi plugins";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment