menu_page_url [ WordPress Function ]
menu_page_url ( $menu_slug, $echo = true )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_page_uri, add_menu_page, add_submenu_page, remove_menu_page, get_page_link
Get the url to access a particular menu page based on the slug it was registered with.
If the slug hasn't been registered properly no url will be returned
Source
<?php
function menu_page_url($menu_slug, $echo = true) {
global $_parent_pages;
if ( isset( $_parent_pages[$menu_slug] ) ) {
$parent_slug = $_parent_pages[$menu_slug];
if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) {
$url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
} else {
$url = admin_url( 'admin.php?page=' . $menu_slug );
}
} else {
$url = '';
}
$url = esc_url($url);
if ( $echo )
echo $url;
return $url;
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Introducing menu_page_url() « westi on wordpress
Introducing menu_page_url(). June 10, 2010 15 Comments. We've just added a new api into WordPress 3.0 to make plugin writing that bit easier – #13829 ...
westi.wordpress.com - Function Reference/menu page url « WordPress Codex
Description. Get the url to access a particular menu page based on the slug it was registered with. If the slug hasn't been registered properly no url will be ...
codex.wordpress.org - #13829 (Introduce menu_page_url($hookname) so plugins don't ...
Fixed in [15203]: Introduce menu_page_url() for plugins to use to get the url for the pages they have added. Fixes #13829 props o'malley for all the cuteness.
core.trac.wordpress.org - Call to undefined function menu_page_url() - Jeff Farthing
Gambled on installing this fantastic plugin to my two new WP 3.2.1, even though Details says it hasn't been tested on this version, because I run ...
www.jfarthing.com