allow_subdomain_install

函数
allow_subdomain_install ( No parameters )
返回值
  • (bool) Whether subdomain installation is allowed
定义位置
相关方法
is_subdomain_installallow_subdirectory_installms_subdomain_constantsinstall_plugin_install_statusdomain_exists
引入
3.0.0
弃用
-

allow_subdomain_install: 这是一个过滤钩子,允许你启用或禁用在子域中安装WordPress的权限。

允许子域安装

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;
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 11:09:38

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: