[wp-trac] [WordPress Trac] #12073: Query Variables for Plugin Menu Pages
WordPress Trac
wp-trac at lists.automattic.com
Fri Feb 12 07:30:39 UTC 2010
#12073: Query Variables for Plugin Menu Pages
----------------------------+-----------------------------------------------
Reporter: jfarthing84 | Owner:
Type: enhancement | Status: closed
Priority: normal | Milestone: Unassigned
Component: Administration | Version: 2.9.1
Severity: normal | Resolution: invalid
Keywords: |
----------------------------+-----------------------------------------------
Changes (by jfarthing84):
* keywords: dev-feedback =>
* status: new => closed
* resolution: => invalid
Comment:
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() {
include WP_PLUGIN_DIR . '/my-plugin/my-page.php';
}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12073#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list