src/includes/classes/Core/Utils/UrlCurrent.php
public function isLocalhost(): bool
    {
        if (($is = &$this->cacheKey(__FUNCTION__)) !== null) {
            return $is; // Cached this already.
        }
        if (defined('LOCALHOST') && LOCALHOST) {
            return $is = true;
        } elseif (preg_match('/(?:\b(?:localhost|127\.0\.0\.1)\b|\.vm)$/ui', $this->host(false))) {
            return $is = true;
        }
        return $is = false;
    }
public function isLocalhost(): bool
    {
        if (($is = &$this->cacheKey(__FUNCTION__)) !== null) {
            return $is; // Cached this already.
        }
        if (defined('LOCALHOST') && LOCALHOST) {
            return $is = true;
        } elseif (preg_match('/(?:\b(?:localhost|127\.0\.0\.1)\b|\.vm)$/ui', $this->host(false))) {
            return $is = true;
        }
        return $is = false;
    }
Current URL is on a localhost?

@since 150424 Initial release.

@return bool `TRUE` if current URL is on a localhost.