get_home_url

SummerySummery

Retrieves the URL for a given site where the front end is accessible.

Syntax

get_home_url( int $blog_id = null, string $path = '', string|null $scheme = null )

DescriptionDescription

Returns the ‘home’ option with the appropriate protocol. The protocol will be ‘https’ if is_ssl() evaluates to true; otherwise, it will be the same as the ‘home’ option. If $scheme is ‘http’ or ‘https’, is_ssl() is overridden.

ParametersParameters

$blog_id

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

Default value: null

$path

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

Default value: ''

$scheme

(string|null) (Optional) Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null.

Default value: null

ReturnReturn

(string) Home URL link with optional path appended.

SourceSource

File: wp-includes/link-template.php


			

ChangelogChangelog

Changelog
Version Description
3.0.0 Introduced.
Scroll to Top