I have a custom WordPress plugin that is showing me a list of data from database. I am registering it’s page via:
add_menu_page(
'NaroÄila',
'Vsa naroÄila',
'administrator',
'listaj-narocila',
array( &$this, 'listaj_narocila' )
);
And then of course I have function lista_narocila
which is showing me my data.
So, currently my URL is:
http://domain.com/wp-admin/admin.php?page=listaj-narocila
And I show my data from database in a table. Now I have button DELETE and EDIT for each record, but I have a hard time figuring it out, how to register custom “url” or “custom page” inside WordPress that would allow me to have URL:
http://domain.com/wp-admin/admin.php?page=single-narocilo?id=X
I know I can try with add_menu_page but I don’t want this page to be in admin menus. Just to be available as URL. Currently I get no access error.
You can create a sub menu page and pass
null
as its parent:A demo:
An alternative approach: https://wordpress.stackexchange.com/a/114818/12615