W3cubDocs

/WordPress

admin_url( string $path = '', string $scheme = 'admin' )

Retrieves the URL to the admin area for the current site.

Parameters

$path

(string) (Optional) path relative to the admin URL.

Default value: ''

$scheme

(string) (Optional) The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http' or 'https' can be passed to force those schemes.

Default value: 'admin'

Return

(string) Admin URL link with optional path appended.

Source

File: wp-includes/link-template.php

function admin_url( $path = '', $scheme = 'admin' ) {
	return get_admin_url( null, $path, $scheme );
}

Changelog

Version Description
2.6.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/admin_url