Function: network_home_url

network_home_url( string $path, string $scheme )

Retrieves the home URL for the current network.

Returns the home URL with the appropriate protocol, 'https' is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is overridden.

Parameters

Name Type(s) Default Value Description
$path string ''

Optional. Path relative to the home URL. Default empty.

$scheme string null

Optional. Scheme to give the home URL context. Accepts 'http', 'https', or 'relative'. Default null.

Returns

string

Home URL link with optional path appended.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.