admin_url filter-hookWP 2.8.0

Filters the admin area URL.

Usage

add_filter( 'admin_url', 'wp_kama_admin_url_filter', 10, 4 );

/**
 * Function for `admin_url` filter-hook.
 * 
 * @param string      $url     The complete admin area URL including scheme and path.
 * @param string      $path    Path relative to the admin area URL. Blank string if no path is specified.
 * @param int|null    $blog_id Site ID, or null for the current site.
 * @param string|null $scheme  The scheme to use. Accepts 'http', 'https', 'admin', or null.
 *
 * @return string
 */
function wp_kama_admin_url_filter( $url, $path, $blog_id, $scheme ){

	// filter...
	return $url;
}
$url(string)
The complete admin area URL including scheme and path.
$path(string)
Path relative to the admin area URL. Blank string if no path is specified.
$blog_id(int|null)
Site ID, or null for the current site.
$scheme(string|null)
The scheme to use. Accepts 'http', 'https', 'admin', or null.
Default: 'admin', which obeys force_ssl_admin() and is_ssl()

Changelog

Since 2.8.0 Introduced.
Since 5.8.0 The $scheme parameter was added.

Where the hook is called

get_admin_url()
admin_url
wp-includes/link-template.php 3575
return apply_filters( 'admin_url', $url, $path, $blog_id, $scheme );

Where the hook is used in WordPress

Usage not found.