views:

14

answers:

1

I'm building a WordPress plugin and I'd like to have an edit-item page that can't be reached via the submenu (because then the item wouldn't be specified).

This resource (http://codex.wordpress.org/Adding_Administration_Menus) shows how to associate an admin page with a function, but not how to do so without adding it as a menu item.

Can this be done?

Thanks!

A: 

Yes, this can be done (well, technically, it would be more like registering the whole thing and then removing the menu item later), but It would just be easiest (I think) to check for parameters in the $_GET superglobal to indicate that the user wishes to edit a specific item. For example, you could have a page that lists items to edit, and clicking 'edit' only adds the item's ID to the current URL. In the function that displays this page, if ID is defined, give them the page to edit that item. Otherwise, give them the list view. That's how posts, pages, and other custom post types do it.

John P Bloch