Want a successful Modern site?
Start with IQRA training; it’s easy and quick to your needs.
How to add sidebar menu or post type
Global Add Action
How to single sidebar menu
function sidebartest(){ single_admin_sidebar_menu('Recharge' , 'admin.php?page=recharge' , '<I class="fa fa-icon"> <i>'); } add_action('register_admin_sibebar' , sidebartest);
How to Multi sidebar menu
data
Add Action
Note:
function IQ_test(){ $array = array( array('All Files'=>'download.php')); $data = array( 'name'=>'Hello', 'primary_name'=> 'Hello File', 'url'=>'home', 'extra_menu' => $array ); add_admin_sidebar_menu($data); } add_action('register_admin_sibebar', 'IQ_test');
How to add sub menu in Already Created Sidebar menu.
function sub_menu(){ global $extramenu; $extramenu[] = ['New Action'=>'admin.php?page=new-action']; } add_action('IQ_admin_sidebar_menu_HelloFile', 'sub_menu');
How to add post type.
function register_post_type(){ register_taxonomy(array('name'=>'News', 'post_type'=>'news','archive'=>'news-page')); } add_action('init' , 'register_post_type'); // Register without Sidebar Create Menu function register_post_type(){ register_taxonomy(array('name'=>'News', 'post_type'=>'news','archive'=>'news-page', 'sidebar'=>false )); } add_action('init' , 'register_post_type');