Retrieves the URL for the current site where the front end is accessible.
Description
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.
Parameters
$pathstringoptional
Path relative to the home URL. Default empty.Default: ''
$schemestring|nulloptional
Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null. Default null.Default: null
Return
string
Home URL link with optional path appended.
Uses · 1
get_home_url()Retrieves the URL for a given site where the front end is accessible.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-includes/link-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.