[wp-trac] [WordPress Trac] #27888: Feature request: `get_current_admin_url()` and `get_current_admin_hook()`
WordPress Trac
noreply at wordpress.org
Fri Apr 18 12:22:45 UTC 2014
#27888: Feature request: `get_current_admin_url()` and `get_current_admin_hook()`
-------------------------------+-----------------------------
Reporter: Denis-de-Bernardy | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 3.9
Severity: normal | Keywords:
Focuses: administration |
-------------------------------+-----------------------------
It would be sweet if to be able to get the current page's url using some
kind of API. And its hook, for that matter. For instance:
{{{
public function get_current_admin_page_url()
{
if (!is_admin()) {
return false;
}
global $pagenow;
global $typenow;
global $taxnow;
global $plugin_page;
$url = $pagenow;
if (!empty($plugin_page)) {
$url .= '?page='.$plugin_page;
}
elseif (!empty($typenow)) {
$url .= '?post_type='.$typenow;
}
elseif (!empty($taxnow)) {
$url .= '?taxonomy='.$taxnow;
}
return $url;
}
}}}
And something similar for `get_current_admin_hook()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27888>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list