home_url

The timeline below displays how wordpress function home_url has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 5.5

/**
 * Retrieves the URL for the current site where the front end is accessible.
 *
 * 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.
 *
 * @since 3.0.0
 *
 * @param string      $path   Optional. Path relative to the home URL. Default empty.
 * @param string|null $scheme Optional. Scheme to give the home URL context. Accepts
 *                            'http', 'https', 'relative', 'rest', or null. Default null.
 * @return string Home URL link with optional path appended.
 */
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}

WordPress Version: 4.7

/**
 * Retrieves the URL for the current site where the front end is accessible.
 *
 * 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.
 *
 * @since 3.0.0
 *
 * @param  string      $path   Optional. Path relative to the home URL. Default empty.
 * @param  string|null $scheme Optional. Scheme to give the home URL context. Accepts
 *                             'http', 'https', 'relative', 'rest', or null. Default null.
 * @return string Home URL link with optional path appended.
 */
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}

WordPress Version: 4.6

/**
 * Retrieves the URL for the current site where the front end is accessible.
 *
 * Returns the 'home' option with the appropriate protocol, 'https' if
 * is_ssl() and 'http' otherwise. If `$scheme` is 'http' or 'https',
 * `is_ssl()` is overridden.
 *
 * @since 3.0.0
 *
 * @param  string      $path   Optional. Path relative to the home URL. Default empty.
 * @param  string|null $scheme Optional. Scheme to give the home URL context. Accepts
 *                             'http', 'https', 'relative', 'rest', or null. Default null.
 * @return string Home URL link with optional path appended.
 */
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}

WordPress Version: 4.5

/**
 * Retrieve the URL for the current site where the front end is accessible.
 *
 * Returns the 'home' option with the appropriate protocol, 'https' if
 * {@see is_ssl()} and 'http' otherwise. If `$scheme` is 'http' or 'https',
 * `is_ssl()` is overridden.
 *
 * @since 3.0.0
 *
 * @param  string      $path   Optional. Path relative to the home url. Default empty.
 * @param  string|null $scheme Optional. Scheme to give the home url context. Accepts
 *                             'http', 'https', 'relative', 'rest', or null. Default null.
 * @return string Home url link with optional path appended.
 */
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}

WordPress Version: 4.4

/**
 * Retrieve the home url for the current site.
 *
 * Returns the 'home' option with the appropriate protocol, 'https' if
 * {@see is_ssl()} and 'http' otherwise. If `$scheme` is 'http' or 'https',
 * `is_ssl()` is overridden.
 *
 * @since 3.0.0
 *
 * @param  string      $path   Optional. Path relative to the home url. Default empty.
 * @param  string|null $scheme Optional. Scheme to give the home url context. Accepts
 *                             'http', 'https', 'relative', 'rest', or null. Default null.
 * @return string Home url link with optional path appended.
*/
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}

WordPress Version: 4.1

/**
 * Retrieve the home url for the current site.
 *
 * Returns the 'home' option with the appropriate protocol, 'https' if
 * {@see is_ssl()} and 'http' otherwise. If `$scheme` is 'http' or 'https',
 * `is_ssl()` is overridden.
 *
 * @since 3.0.0
 *
 * @param  string $path   Optional. Path relative to the home url. Default empty.
 * @param  string $scheme Optional. Scheme to give the home url context. Accepts
 *                        'http', 'https', or 'relative'. Default null.
 * @return string Home url link with optional path appended.
*/
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}

WordPress Version: 3.9

/**
 * Retrieve the home url for the current site.
 *
 * Returns the 'home' option with the appropriate protocol, 'https' if
 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
 * overridden.
 *
 * @since 3.0.0
 *
 * @uses get_home_url()
 *
 * @param  string $path   (optional) Path relative to the home url.
 * @param  string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https', or 'relative'.
 * @return string Home url link with optional path appended.
*/
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}

WordPress Version: 3.7

/**
 * Retrieve the home url for the current site.
 *
 * Returns the 'home' option with the appropriate protocol, 'https' if
 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is
 * overridden.
 *
 * @package WordPress
 * @since 3.0.0
 *
 * @uses get_home_url()
 *
 * @param  string $path   (optional) Path relative to the home url.
 * @param  string $scheme (optional) Scheme to give the home url context. Currently 'http', 'https', or 'relative'.
 * @return string Home url link with optional path appended.
*/
function home_url($path = '', $scheme = null)
{
    return get_home_url(null, $path, $scheme);
}