wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
menu_page_url › WordPress Function
Seit3.0.0
Veraltetn/v
› menu_page_url ( $menu_slug, $display = true )
Parameter: (2) |
|
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Gets 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.Quellcode
function menu_page_url( $menu_slug, $display = 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 ( $display ) { echo $url; } return $url; }