Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
network_step1 example
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
(
)
;
}