本文整理匯總了PHP中network_domain_check函數的典型用法代碼示例。如果您正苦於以下問題:PHP network_domain_check函數的具體用法?PHP network_domain_check怎麽用?PHP network_domain_check使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了network_domain_check函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_clean_basedomain
/**
* Get base domain of network.
*
* @since 3.0.0
* @return string Base domain.
*/
function get_clean_basedomain()
{
if ($existing_domain = network_domain_check()) {
return $existing_domain;
}
$domain = preg_replace('|https?://|', '', get_option('siteurl'));
if ($slash = strpos($domain, '/')) {
$domain = substr($domain, 0, $slash);
}
return $domain;
}
示例2: gather
protected function gather()
{
$results = [];
// Multisite
$results[] = ['method' => 'info', 'message' => 'Multisite: ' . yesno(is_multisite())];
// Blog tables
if (is_blog_installed()) {
$results[] = ['method' => 'info', 'message' => 'Blog installed: ' . yesno(true)];
} else {
$results[] = ['method' => 'error', 'message' => 'Blog installed: ' . yesno(false)];
}
// php.ini
$results[] = ['method' => 'info', 'message' => 'post_max_size: ' . ini_get('post_max_size')];
$results[] = ['method' => 'info', 'message' => 'upload_max_filesize: ' . ini_get('upload_max_filesize')];
if (env('WP_MULTISITE')) {
$this->info('Network Domain: ', network_domain_check());
} else {
}
return $results;
}
示例3: check_admin_referer
if ($_POST) {
check_admin_referer('install-network-1');
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
// Create network tables.
install_network();
$base = parse_url(trailingslashit(get_option('home')), PHP_URL_PATH);
$subdomain_install = allow_subdomain_install() ? !empty($_POST['subdomain_install']) : false;
if (!network_domain_check()) {
$result = populate_network(1, get_clean_basedomain(), sanitize_email($_POST['email']), wp_unslash($_POST['sitename']), $base, $subdomain_install);
if (is_wp_error($result)) {
if (1 == count($result->get_error_codes()) && 'no_wildcard_dns' == $result->get_error_code()) {
network_step2($result);
} else {
network_step1($result);
}
} else {
network_step2();
}
} else {
network_step2();
}
} elseif (is_multisite() || network_domain_check()) {
network_step2();
} else {
network_step1();
}
?>
</div>
<?php
include ABSPATH . 'wp-admin/admin-footer.php';