#12073 closed enhancement (invalid)
Query Variables for Plugin Menu Pages
| Reported by: | jfarthing84 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 2.9.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
I would like to be able to pass query variables through the admin menu functions. For instance, I have multiple "entities" that can all be managed from the same form. However, there is no way to specify "entity=type" in the query for the menu page. So, I have to create a separate PHP file for each "entity", that in turn includes the "edit-entity.php" file along with a variable specifying which "entity" type it is. This would be easily achieved with a query value of the "entity" type. The new WordPress taxonomy system works this way. Let's support it for plugins too.
Change History (4)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
It seems a found a way around this. Specify the file with a query variable but still use a function to include the file you wished to query. For example, instead of using the following (which doesn't work) to try and load a file:
add_submenu_page($parent, 'Title', 'Title', 'manage_options', 'my-plugin/my-page.php?key=value');
Use this and it works:
add_submenu_page($parent, 'Title', 'Title', 'manage_options', 'my-plugin/my-page.php?key=value', 'load_my_page');
function load_my_page() {
}