How to add admin Menu in wordpress

Post Reply
studgomel
Site Admin
Posts: 31
Joined: Wed Feb 27, 2019 3:48 am

How to add admin Menu in wordpress

Post by studgomel » Fri Mar 01, 2019 1:25 am

:twisted:

Hi Friends, The below functions are giving help for How to add admin menus and submenus in wordpress.

//This function is for add menu to the admin area in wordpress

Code: Select all


add_menu_page( $this->page_title, 
$this->menu_title, $this->access_level, 
$this->plugin_dir, array ( $this , 'main_page'), $this->imgUrl.'pageFlip.gif' ); 

//The below functions for add submenu to the admin area in wordpress

Code: Select all


add_submenu_page( $this->plugin_dir, __('Categories', 'news'), 
__('Categories', 'news'), $this->access_level, 
'categories', array( $this, 'categories' ) ); 
add_submenu_page( $this->plugin_dir, __('Images', 'news'), 
__('Images', 'news'), $this->access_level, 
'images', array( $this, 'images' ) ); 
It may be helping wordpress learners.

Thank you

Return to “wordpress”