allow_subdomain_install

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

WordPress Version: 5.4

/**
 * Allow subdomain installation
 *
 * @since 3.0.0
 * @return bool Whether subdomain installation is allowed
 */
function allow_subdomain_install()
{
    $domain = preg_replace('|https?://([^/]+)|', '$1', get_option('home'));
    if (parse_url(get_option('home'), PHP_URL_PATH) || 'localhost' === $domain || preg_match('|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain)) {
        return false;
    }
    return true;
}

WordPress Version: 4.9

/**
 * Allow subdomain installation
 *
 * @since 3.0.0
 * @return bool Whether subdomain installation is allowed
 */
function allow_subdomain_install()
{
    $domain = preg_replace('|https?://([^/]+)|', '$1', get_option('home'));
    if (parse_url(get_option('home'), PHP_URL_PATH) || 'localhost' == $domain || preg_match('|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain)) {
        return false;
    }
    return true;
}

WordPress Version: 3.7

/**
 * Allow subdomain install
 *
 * @since 3.0.0
 * @return bool Whether subdomain install is allowed
 */
function allow_subdomain_install()
{
    $domain = preg_replace('|https?://([^/]+)|', '$1', get_option('home'));
    if (parse_url(get_option('home'), PHP_URL_PATH) || 'localhost' == $domain || preg_match('|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain)) {
        return false;
    }
    return true;
}