Admin tabs for custom plugin
You should be able to use the admin_url() function; it returns the admin URL with the first parameter appended, optionally: admin_url( ‘admin.php?page=bigname’ );
You should be able to use the admin_url() function; it returns the admin URL with the first parameter appended, optionally: admin_url( ‘admin.php?page=bigname’ );
I have added custom menu link by following. Hope it will be helpful. add_action( ‘admin_menu’ , ‘custom_admin_menu_new_items’ ); function custom_admin_menu_new_items() { global $menu; add_menu_page( ‘My Page’, ‘My Page’, ‘manage_options’, ‘my-page’, ”,”, 6 ); foreach($menu as $mIndex => $mData) { if($mData[2] == ‘my-page’) { $menu[$mIndex][2] = ‘http://mypage.com/mypage’; break; } } } Action hook admin_menu is used. … Read more
There are more reliable functions to remove menus and submenus in WP admin area. Those functions are remove_menu_page and remove_submenu_page. I don’t know if the menus you want to remove are top level menus or submenus neither the slug of the menus (needed for these functions), so I can not give you the exact code … Read more
Headers already sent error when creating multiple admin menu’s
It can not work for user roles that don’t see and don’t have access to the menu section. It just is not there – for them -, so you can’t address it, hence the errors you are getting. Just add a check: if( current_user_can( ‘edit_posts’ ) ) { //code }
How to check an admin submenu already exists?
how to remove wp admin menu created by plugin
How to remove an item from menu bar’s +New menu based on User role
I think you will achieve what you want by using [get_current_screen()][1] and reading the properties from WP_Screen object returned as needed. In your case, I think you will need $screen->base or maybe $screen->id. According to WordPress Codex: id (string) The unique ID of the screen and base (string) The base type of the screen. For … Read more
I would ensure that your user is an ‘admin’ type. Then I would reinstall WP core files (via the update, if that is available; otherwise you will have to do a selective file transfer so as to not to overwrite your settings). I would also rename the ‘plugins’ folder to ‘xxplugins’ temporarily, to ensure that … Read more