get_admin_url

Advertisement

Summery Summery

Retrieves the URL to the admin area for a given site.

Syntax Syntax

get_admin_url( int $blog_id = null, string $path = '', string $scheme = 'admin' )

Parameters Parameters

$blog_id

(int) (Optional) Site ID. Default null (current site).

Default value: null

$path

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

Default value: ''

$scheme

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

Default value: 'admin'

Return Return

(string) Admin URL link with optional path appended.

Source Source

File: wp-includes/link-template.php

 *                       'http' or 'https' can be passed to force those schemes.
 * @return string Admin URL link with optional path appended.
 */
function admin_url( $path = '', $scheme = 'admin' ) {
	return get_admin_url( null, $path, $scheme );
}

/**
 * Retrieves the URL to the admin area for a given site.
 *
 * @since 3.0.0
 *
 * @param int    $blog_id Optional. Site ID. Default null (current site).
 * @param string $path    Optional. Path relative to the admin URL. Default empty.
 * @param string $scheme  Optional. The scheme to use. Accepts 'http' or 'https',
 *                        to force those schemes. Default 'admin', which obeys
 *                        force_ssl_admin() and is_ssl().
 * @return string Admin URL link with optional path appended.

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.