W3cubDocs

/WordPress

admin_url( string $path = , string $scheme = ‘admin’ ): string

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

Parameters

$pathstringoptional
Path relative to the admin URL.

Default:''

$schemestringoptional
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:'admin'

Return

string Admin URL link with optional path appended.

Source

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

Changelog

Version Description
2.6.0 Introduced.

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