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

Changelog
Version Description
WP-2.6.0 Introduced.