1

Assume I have the following code

add_menu_page('My Title', 'My Title', 'publish_posts', 'my-slug', function () {
    require_once ('path/to/render/page.php');
});

This code will add a menu item to the side bar of the admin section, and if you click on that new menu item, and inspect the URL,

http://example.com/wp-admin/admin.php?page=my-slug

Everything is great so far.

Now my question: Is it possible to change the default URL above to something maybe like this?

http://example.com/wp-admin/my-slug

Or this?

http://example.com/wp-admin/page/my-slug

Or even this?

http://example.com/wp-admin/admin.php/page/my-slug

Basically, I do NOT want the query variables to be displayed as shown in the default setup. In other words, can I change the permalinks for the back-end?

Thank you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.