network_home_url()
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() overridden.
Hooks from the function
Return
String
. Home URL link with optional path appended.
Usage
network_home_url( $path, $scheme );
- $path(string)
- Path relative to the home URL.
Default: '' - $scheme(string|null)
- Scheme to give the home URL context. Accepts 'http', 'https', or 'relative'.
Default: null
Examples
#1 Get the link to the main blog of the network of sites
echo network_home_url(); // outputs: http://www.example.com
Changelog
Since 3.0.0 | Introduced. |