is_subdomain_install()判断子域名是否安装成功(多站点)

目录

描述

Whether a sub-domain configuration is enabled. This function was added in version 3.0.0.

is_subdomain_install() 描述

用法

<?php is_subdomain_install(); ?>

is_subdomain_install() 用法

参数

返回值

(Boolean) 

True if sub-domain configuration is enabled, false otherwise.

is_subdomain_install() 返回值

源文件

is_subdomain_install() 函数的代码位于 wp-includes/ms-load.php.

/* ----------------------------------
 * wordpress之魂 © http://wphun.com
 * ---------------------------------- */
/**
 * Whether a subdomain configuration is enabled.
 *
 * @since 3.0.0
 *
 * @return bool True if subdomain configuration is enabled, false otherwise.
 */
function is_subdomain_install() {
	if ( defined('SUBDOMAIN_INSTALL') )
		return SUBDOMAIN_INSTALL;

	return ( defined( 'VHOST' ) && VHOST == 'yes' );
}

is_subdomain_install() 源文件