how to create a menu in dashboard for plugin?

  • 0

add_action(‘admin_menu’, ‘avg_rate_add_page’);
function avg_rate_add_page(){

// Add main menu

add_menu_page(‘Bonuspoints’, ‘Bonus point’, ‘administrator’, ‘avg_rate_page’,’avg_rate_options_settings’,’bonus.jpg’, ‘manage_options’);

// Add Sub menu
add_submenu_page( ‘avg_rate_page’, ‘Add points’, ‘Add points’, ‘manage_options’, ‘avg_rate_add_points’, ‘myplguin_admin_sub_page’ );
}
function avg_rate_options_settings(){
/* code for main menu*/
}
function myplguin_admin_sub_page(){

/* code for sub menu*/
}

For deatils about menu creation arguments :
https://codex.wordpress.org/Administration_Menus

add_action(‘admin_menu’, ‘avg_rate_add_page’); function avg_rate_add_page(){ // Add main menu add_menu_page(‘Bonuspoints’, ‘Bonus point’, ‘administrator’, ‘avg_rate_page’,’avg_rate_options_settings’,’bonus.jpg’, ‘manage_options’); // Add Sub menu add_submenu_page( ‘avg_rate_page’, ‘Add points’, ‘Add points’, ‘manage_options’, ‘avg_rate_add_points’, ‘myplguin_admin_sub_page’ ); } function avg_rate_options_settings(){ /* code for main menu*/ } function myplguin_admin_sub_page(){ /* code for sub menu*/ } For deatils about menu creation arguments : https://codex.wordpress.org/Administration_Menus

add_action(‘admin_menu’, ‘avg_rate_add_page’); function avg_rate_add_page(){ // Add main menu add_menu_page(‘Bonuspoints’, ‘Bonus point’, ‘administrator’, ‘avg_rate_page’,’avg_rate_options_settings’,’bonus.jpg’, ‘manage_options’); // Add Sub menu add_submenu_page( ‘avg_rate_page’, ‘Add points’, ‘Add points’, ‘manage_options’, ‘avg_rate_add_points’, ‘myplguin_admin_sub_page’ ); } function avg_rate_options_settings(){ /* code for main menu*/ } function myplguin_admin_sub_page(){ /* code for sub menu*/ } For deatils about menu creation arguments : https://codex.wordpress.org/Administration_Menus