Add menu and submenu in admin with a URL instead of slug?

Question

I use this function and hook:

function mysite_admin_menu() 
{
  add_menu_page( 'Categories', 'Catégories', 'administrator', 'categories', 'a_function' );
  add_submenu_page( 'categories', 'Manage', 'Manage', 'administrator', 'xxx', 'a_function' );
  remove_submenu_page('categories','categories');
}
add_action( 'admin_menu', 'mysite_admin_menu' );

It displays what I need: a menu with a submenu on the left admin menu bar.

The thing is, the submenu leads to this page: admin.php?page=xxx.

How can I do to link to a URL like edit-tags.php?taxonomy=category?

If I swap the slug in the add_submenu_page with a relative URL, the link will lead to
admin.php?page=edit-tags.php?taxonomy=category.

Whatever I do, I always get admin.php?page=... which is not what I want.

0
, , Baylock 1 year 2020-07-18T15:10:20-05:00 0 Answers 56 views 0

Leave an answer

Browse
Browse