WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

menu_page_url() WP 3.0.0

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.

Хуков нет.

Возвращает

Строку. The menu page URL.

Использование

menu_page_url( $menu_slug, $echo );
$menu_slug(строка) (обязательный)
The slug name to refer to this menu by (should be unique for this menu).
$echo(true/false)
Whether or not to echo the URL.
По умолчанию: true

Заметки

  • Global. Массив. $_parent_pages

Список изменений

С версии 3.0.0 Введена.

Код menu_page_url() WP 5.5.1

wp-admin/includes/plugin.php
<?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;
}