Edit File by line
/home/barbar84/www
File: wp-signup.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/** Sets up the WordPress Environment. */
[2] Fix | Delete
require __DIR__ . '/wp-load.php';
[3] Fix | Delete
[4] Fix | Delete
add_filter( 'wp_robots', 'wp_robots_no_robots' );
[5] Fix | Delete
[6] Fix | Delete
require __DIR__ . '/wp-blog-header.php';
[7] Fix | Delete
[8] Fix | Delete
nocache_headers();
[9] Fix | Delete
[10] Fix | Delete
if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new'], get_site_option( 'illegal_names' ), true ) ) {
[11] Fix | Delete
wp_redirect( network_home_url() );
[12] Fix | Delete
die();
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
/**
[16] Fix | Delete
* Prints signup_header via wp_head
[17] Fix | Delete
*
[18] Fix | Delete
* @since MU (3.0.0)
[19] Fix | Delete
*/
[20] Fix | Delete
function do_signup_header() {
[21] Fix | Delete
/**
[22] Fix | Delete
* Fires within the head section of the site sign-up screen.
[23] Fix | Delete
*
[24] Fix | Delete
* @since 3.0.0
[25] Fix | Delete
*/
[26] Fix | Delete
do_action( 'signup_header' );
[27] Fix | Delete
}
[28] Fix | Delete
add_action( 'wp_head', 'do_signup_header' );
[29] Fix | Delete
[30] Fix | Delete
if ( ! is_multisite() ) {
[31] Fix | Delete
wp_redirect( wp_registration_url() );
[32] Fix | Delete
die();
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
if ( ! is_main_site() ) {
[36] Fix | Delete
wp_redirect( network_site_url( 'wp-signup.php' ) );
[37] Fix | Delete
die();
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
// Fix for page title.
[41] Fix | Delete
$wp_query->is_404 = false;
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Fires before the Site Signup page is loaded.
[45] Fix | Delete
*
[46] Fix | Delete
* @since 4.4.0
[47] Fix | Delete
*/
[48] Fix | Delete
do_action( 'before_signup_header' );
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Prints styles for front-end Multisite signup pages
[52] Fix | Delete
*
[53] Fix | Delete
* @since MU (3.0.0)
[54] Fix | Delete
*/
[55] Fix | Delete
function wpmu_signup_stylesheet() {
[56] Fix | Delete
?>
[57] Fix | Delete
<style type="text/css">
[58] Fix | Delete
.mu_register { width: 90%; margin:0 auto; }
[59] Fix | Delete
.mu_register form { margin-top: 2em; }
[60] Fix | Delete
.mu_register .error { font-weight: 600; padding: 10px; color: #333333; background: #FFEBE8; border: 1px solid #CC0000; }
[61] Fix | Delete
.mu_register input[type="submit"],
[62] Fix | Delete
.mu_register #blog_title,
[63] Fix | Delete
.mu_register #user_email,
[64] Fix | Delete
.mu_register #blogname,
[65] Fix | Delete
.mu_register #user_name { width:100%; font-size: 24px; margin:5px 0; }
[66] Fix | Delete
.mu_register #site-language { display: block; }
[67] Fix | Delete
.mu_register .prefix_address,
[68] Fix | Delete
.mu_register .suffix_address { font-size: 18px; display:inline; }
[69] Fix | Delete
.mu_register label { font-weight: 600; font-size: 15px; display: block; margin: 10px 0; }
[70] Fix | Delete
.mu_register label.checkbox { display:inline; }
[71] Fix | Delete
.mu_register .mu_alert { font-weight: 600; padding: 10px; color: #333333; background: #ffffe0; border: 1px solid #e6db55; }
[72] Fix | Delete
</style>
[73] Fix | Delete
<?php
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
add_action( 'wp_head', 'wpmu_signup_stylesheet' );
[77] Fix | Delete
get_header( 'wp-signup' );
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* Fires before the site sign-up form.
[81] Fix | Delete
*
[82] Fix | Delete
* @since 3.0.0
[83] Fix | Delete
*/
[84] Fix | Delete
do_action( 'before_signup_form' );
[85] Fix | Delete
?>
[86] Fix | Delete
<div id="signup-content" class="widecolumn">
[87] Fix | Delete
<div class="mu_register wp-signup-container" role="main">
[88] Fix | Delete
<?php
[89] Fix | Delete
/**
[90] Fix | Delete
* Generates and displays the Signup and Create Site forms
[91] Fix | Delete
*
[92] Fix | Delete
* @since MU (3.0.0)
[93] Fix | Delete
*
[94] Fix | Delete
* @param string $blogname The new site name.
[95] Fix | Delete
* @param string $blog_title The new site title.
[96] Fix | Delete
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string.
[97] Fix | Delete
*/
[98] Fix | Delete
function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
[99] Fix | Delete
if ( ! is_wp_error( $errors ) ) {
[100] Fix | Delete
$errors = new WP_Error();
[101] Fix | Delete
}
[102] Fix | Delete
[103] Fix | Delete
$current_network = get_network();
[104] Fix | Delete
// Blog name.
[105] Fix | Delete
if ( ! is_subdomain_install() ) {
[106] Fix | Delete
echo '<label for="blogname">' . __( 'Site Name:' ) . '</label>';
[107] Fix | Delete
} else {
[108] Fix | Delete
echo '<label for="blogname">' . __( 'Site Domain:' ) . '</label>';
[109] Fix | Delete
}
[110] Fix | Delete
[111] Fix | Delete
$errmsg = $errors->get_error_message( 'blogname' );
[112] Fix | Delete
if ( $errmsg ) {
[113] Fix | Delete
?>
[114] Fix | Delete
<p class="error"><?php echo $errmsg; ?></p>
[115] Fix | Delete
<?php
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
if ( ! is_subdomain_install() ) {
[119] Fix | Delete
echo '<span class="prefix_address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" /><br />';
[120] Fix | Delete
} else {
[121] Fix | Delete
$site_domain = preg_replace( '|^www\.|', '', $current_network->domain );
[122] Fix | Delete
echo '<input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" /><span class="suffix_address">.' . esc_html( $site_domain ) . '</span><br />';
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
if ( ! is_user_logged_in() ) {
[126] Fix | Delete
if ( ! is_subdomain_install() ) {
[127] Fix | Delete
$site = $current_network->domain . $current_network->path . __( 'sitename' );
[128] Fix | Delete
} else {
[129] Fix | Delete
$site = __( 'domain' ) . '.' . $site_domain . $current_network->path;
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
printf(
[133] Fix | Delete
'<p>(<strong>%s</strong>) %s</p>',
[134] Fix | Delete
/* translators: %s: Site address. */
[135] Fix | Delete
sprintf( __( 'Your address will be %s.' ), $site ),
[136] Fix | Delete
__( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' )
[137] Fix | Delete
);
[138] Fix | Delete
}
[139] Fix | Delete
[140] Fix | Delete
// Site Title.
[141] Fix | Delete
?>
[142] Fix | Delete
<label for="blog_title"><?php _e( 'Site Title:' ); ?></label>
[143] Fix | Delete
<?php
[144] Fix | Delete
$errmsg = $errors->get_error_message( 'blog_title' );
[145] Fix | Delete
if ( $errmsg ) {
[146] Fix | Delete
?>
[147] Fix | Delete
<p class="error"><?php echo $errmsg; ?></p>
[148] Fix | Delete
<?php
[149] Fix | Delete
}
[150] Fix | Delete
echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" />';
[151] Fix | Delete
?>
[152] Fix | Delete
[153] Fix | Delete
<?php
[154] Fix | Delete
// Site Language.
[155] Fix | Delete
$languages = signup_get_available_languages();
[156] Fix | Delete
[157] Fix | Delete
if ( ! empty( $languages ) ) :
[158] Fix | Delete
?>
[159] Fix | Delete
<p>
[160] Fix | Delete
<label for="site-language"><?php _e( 'Site Language:' ); ?></label>
[161] Fix | Delete
<?php
[162] Fix | Delete
// Network default.
[163] Fix | Delete
$lang = get_site_option( 'WPLANG' );
[164] Fix | Delete
[165] Fix | Delete
if ( isset( $_POST['WPLANG'] ) ) {
[166] Fix | Delete
$lang = $_POST['WPLANG'];
[167] Fix | Delete
}
[168] Fix | Delete
[169] Fix | Delete
// Use US English if the default isn't available.
[170] Fix | Delete
if ( ! in_array( $lang, $languages, true ) ) {
[171] Fix | Delete
$lang = '';
[172] Fix | Delete
}
[173] Fix | Delete
[174] Fix | Delete
wp_dropdown_languages(
[175] Fix | Delete
array(
[176] Fix | Delete
'name' => 'WPLANG',
[177] Fix | Delete
'id' => 'site-language',
[178] Fix | Delete
'selected' => $lang,
[179] Fix | Delete
'languages' => $languages,
[180] Fix | Delete
'show_available_translations' => false,
[181] Fix | Delete
)
[182] Fix | Delete
);
[183] Fix | Delete
?>
[184] Fix | Delete
</p>
[185] Fix | Delete
<?php
[186] Fix | Delete
endif; // Languages.
[187] Fix | Delete
[188] Fix | Delete
$blog_public_on_checked = '';
[189] Fix | Delete
$blog_public_off_checked = '';
[190] Fix | Delete
if ( isset( $_POST['blog_public'] ) && '0' === $_POST['blog_public'] ) {
[191] Fix | Delete
$blog_public_off_checked = 'checked="checked"';
[192] Fix | Delete
} else {
[193] Fix | Delete
$blog_public_on_checked = 'checked="checked"';
[194] Fix | Delete
}
[195] Fix | Delete
?>
[196] Fix | Delete
[197] Fix | Delete
<div id="privacy">
[198] Fix | Delete
<p class="privacy-intro">
[199] Fix | Delete
<?php _e( 'Privacy:' ); ?>
[200] Fix | Delete
<?php _e( 'Allow search engines to index this site.' ); ?>
[201] Fix | Delete
<br style="clear:both" />
[202] Fix | Delete
<label class="checkbox" for="blog_public_on">
[203] Fix | Delete
<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> />
[204] Fix | Delete
<strong><?php _e( 'Yes' ); ?></strong>
[205] Fix | Delete
</label>
[206] Fix | Delete
<label class="checkbox" for="blog_public_off">
[207] Fix | Delete
<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php echo $blog_public_off_checked; ?> />
[208] Fix | Delete
<strong><?php _e( 'No' ); ?></strong>
[209] Fix | Delete
</label>
[210] Fix | Delete
</p>
[211] Fix | Delete
</div>
[212] Fix | Delete
[213] Fix | Delete
<?php
[214] Fix | Delete
/**
[215] Fix | Delete
* Fires after the site sign-up form.
[216] Fix | Delete
*
[217] Fix | Delete
* @since 3.0.0
[218] Fix | Delete
*
[219] Fix | Delete
* @param WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors.
[220] Fix | Delete
*/
[221] Fix | Delete
do_action( 'signup_blogform', $errors );
[222] Fix | Delete
}
[223] Fix | Delete
[224] Fix | Delete
/**
[225] Fix | Delete
* Validate the new site signup
[226] Fix | Delete
*
[227] Fix | Delete
* @since MU (3.0.0)
[228] Fix | Delete
*
[229] Fix | Delete
* @return array Contains the new site data and error messages.
[230] Fix | Delete
*/
[231] Fix | Delete
function validate_blog_form() {
[232] Fix | Delete
$user = '';
[233] Fix | Delete
if ( is_user_logged_in() ) {
[234] Fix | Delete
$user = wp_get_current_user();
[235] Fix | Delete
}
[236] Fix | Delete
[237] Fix | Delete
return wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'], $user );
[238] Fix | Delete
}
[239] Fix | Delete
[240] Fix | Delete
/**
[241] Fix | Delete
* Displays the fields for the new user account registration form.
[242] Fix | Delete
*
[243] Fix | Delete
* @since MU (3.0.0)
[244] Fix | Delete
*
[245] Fix | Delete
* @param string $user_name The entered username.
[246] Fix | Delete
* @param string $user_email The entered email address.
[247] Fix | Delete
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string.
[248] Fix | Delete
*/
[249] Fix | Delete
function show_user_form( $user_name = '', $user_email = '', $errors = '' ) {
[250] Fix | Delete
if ( ! is_wp_error( $errors ) ) {
[251] Fix | Delete
$errors = new WP_Error();
[252] Fix | Delete
}
[253] Fix | Delete
[254] Fix | Delete
// Username.
[255] Fix | Delete
echo '<label for="user_name">' . __( 'Username:' ) . '</label>';
[256] Fix | Delete
$errmsg = $errors->get_error_message( 'user_name' );
[257] Fix | Delete
if ( $errmsg ) {
[258] Fix | Delete
echo '<p class="error">' . $errmsg . '</p>';
[259] Fix | Delete
}
[260] Fix | Delete
echo '<input name="user_name" type="text" id="user_name" value="' . esc_attr( $user_name ) . '" autocapitalize="none" autocorrect="off" maxlength="60" /><br />';
[261] Fix | Delete
_e( '(Must be at least 4 characters, letters and numbers only.)' );
[262] Fix | Delete
?>
[263] Fix | Delete
[264] Fix | Delete
<label for="user_email"><?php _e( 'Email&nbsp;Address:' ); ?></label>
[265] Fix | Delete
<?php
[266] Fix | Delete
$errmsg = $errors->get_error_message( 'user_email' );
[267] Fix | Delete
if ( $errmsg ) {
[268] Fix | Delete
?>
[269] Fix | Delete
<p class="error"><?php echo $errmsg; ?></p>
[270] Fix | Delete
<?php } ?>
[271] Fix | Delete
<input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" /><br /><?php _e( 'We send your registration email to this address. (Double-check your email address before continuing.)' ); ?>
[272] Fix | Delete
<?php
[273] Fix | Delete
$errmsg = $errors->get_error_message( 'generic' );
[274] Fix | Delete
if ( $errmsg ) {
[275] Fix | Delete
echo '<p class="error">' . $errmsg . '</p>';
[276] Fix | Delete
}
[277] Fix | Delete
/**
[278] Fix | Delete
* Fires at the end of the new user account registration form.
[279] Fix | Delete
*
[280] Fix | Delete
* @since 3.0.0
[281] Fix | Delete
*
[282] Fix | Delete
* @param WP_Error $errors A WP_Error object containing 'user_name' or 'user_email' errors.
[283] Fix | Delete
*/
[284] Fix | Delete
do_action( 'signup_extra_fields', $errors );
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
/**
[288] Fix | Delete
* Validate user signup name and email
[289] Fix | Delete
*
[290] Fix | Delete
* @since MU (3.0.0)
[291] Fix | Delete
*
[292] Fix | Delete
* @return array Contains username, email, and error messages.
[293] Fix | Delete
*/
[294] Fix | Delete
function validate_user_form() {
[295] Fix | Delete
return wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );
[296] Fix | Delete
}
[297] Fix | Delete
[298] Fix | Delete
/**
[299] Fix | Delete
* Allow returning users to sign up for another site
[300] Fix | Delete
*
[301] Fix | Delete
* @since MU (3.0.0)
[302] Fix | Delete
*
[303] Fix | Delete
* @param string $blogname The new site name
[304] Fix | Delete
* @param string $blog_title The new site title.
[305] Fix | Delete
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string.
[306] Fix | Delete
*/
[307] Fix | Delete
function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
[308] Fix | Delete
$current_user = wp_get_current_user();
[309] Fix | Delete
[310] Fix | Delete
if ( ! is_wp_error( $errors ) ) {
[311] Fix | Delete
$errors = new WP_Error();
[312] Fix | Delete
}
[313] Fix | Delete
[314] Fix | Delete
$signup_defaults = array(
[315] Fix | Delete
'blogname' => $blogname,
[316] Fix | Delete
'blog_title' => $blog_title,
[317] Fix | Delete
'errors' => $errors,
[318] Fix | Delete
);
[319] Fix | Delete
[320] Fix | Delete
/**
[321] Fix | Delete
* Filters the default site sign-up variables.
[322] Fix | Delete
*
[323] Fix | Delete
* @since 3.0.0
[324] Fix | Delete
*
[325] Fix | Delete
* @param array $signup_defaults {
[326] Fix | Delete
* An array of default site sign-up variables.
[327] Fix | Delete
*
[328] Fix | Delete
* @type string $blogname The site blogname.
[329] Fix | Delete
* @type string $blog_title The site title.
[330] Fix | Delete
* @type WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors.
[331] Fix | Delete
* }
[332] Fix | Delete
*/
[333] Fix | Delete
$filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults );
[334] Fix | Delete
[335] Fix | Delete
$blogname = $filtered_results['blogname'];
[336] Fix | Delete
$blog_title = $filtered_results['blog_title'];
[337] Fix | Delete
$errors = $filtered_results['errors'];
[338] Fix | Delete
[339] Fix | Delete
/* translators: %s: Network title. */
[340] Fix | Delete
echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), get_network()->site_name ) . '</h2>';
[341] Fix | Delete
[342] Fix | Delete
if ( $errors->has_errors() ) {
[343] Fix | Delete
echo '<p>' . __( 'There was a problem, please correct the form below and try again.' ) . '</p>';
[344] Fix | Delete
}
[345] Fix | Delete
?>
[346] Fix | Delete
<p>
[347] Fix | Delete
<?php
[348] Fix | Delete
printf(
[349] Fix | Delete
/* translators: %s: Current user's display name. */
[350] Fix | Delete
__( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ),
[351] Fix | Delete
$current_user->display_name
[352] Fix | Delete
);
[353] Fix | Delete
?>
[354] Fix | Delete
</p>
[355] Fix | Delete
[356] Fix | Delete
<?php
[357] Fix | Delete
$blogs = get_blogs_of_user( $current_user->ID );
[358] Fix | Delete
if ( ! empty( $blogs ) ) {
[359] Fix | Delete
?>
[360] Fix | Delete
[361] Fix | Delete
<p><?php _e( 'Sites you are already a member of:' ); ?></p>
[362] Fix | Delete
<ul>
[363] Fix | Delete
<?php
[364] Fix | Delete
foreach ( $blogs as $blog ) {
[365] Fix | Delete
$home_url = get_home_url( $blog->userblog_id );
[366] Fix | Delete
echo '<li><a href="' . esc_url( $home_url ) . '">' . $home_url . '</a></li>';
[367] Fix | Delete
}
[368] Fix | Delete
?>
[369] Fix | Delete
</ul>
[370] Fix | Delete
<?php } ?>
[371] Fix | Delete
[372] Fix | Delete
<p><?php _e( 'If you&#8217;re not going to use a great site domain, leave it for a new user. Now have at it!' ); ?></p>
[373] Fix | Delete
<form id="setupform" method="post" action="wp-signup.php">
[374] Fix | Delete
<input type="hidden" name="stage" value="gimmeanotherblog" />
[375] Fix | Delete
<?php
[376] Fix | Delete
/**
[377] Fix | Delete
* Hidden sign-up form fields output when creating another site or user.
[378] Fix | Delete
*
[379] Fix | Delete
* @since MU (3.0.0)
[380] Fix | Delete
*
[381] Fix | Delete
* @param string $context A string describing the steps of the sign-up process. The value can be
[382] Fix | Delete
* 'create-another-site', 'validate-user', or 'validate-site'.
[383] Fix | Delete
*/
[384] Fix | Delete
do_action( 'signup_hidden_fields', 'create-another-site' );
[385] Fix | Delete
?>
[386] Fix | Delete
<?php show_blog_form( $blogname, $blog_title, $errors ); ?>
[387] Fix | Delete
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ); ?>" /></p>
[388] Fix | Delete
</form>
[389] Fix | Delete
<?php
[390] Fix | Delete
}
[391] Fix | Delete
[392] Fix | Delete
/**
[393] Fix | Delete
* Validate a new site signup for an existing user.
[394] Fix | Delete
*
[395] Fix | Delete
* @global string $blogname The new site's subdomain or directory name.
[396] Fix | Delete
* @global string $blog_title The new site's title.
[397] Fix | Delete
* @global WP_Error $errors Existing errors in the global scope.
[398] Fix | Delete
* @global string $domain The new site's domain.
[399] Fix | Delete
* @global string $path The new site's path.
[400] Fix | Delete
*
[401] Fix | Delete
* @since MU (3.0.0)
[402] Fix | Delete
*
[403] Fix | Delete
* @return null|bool True if site signup was validated, false if error.
[404] Fix | Delete
* The function halts all execution if the user is not logged in.
[405] Fix | Delete
*/
[406] Fix | Delete
function validate_another_blog_signup() {
[407] Fix | Delete
global $blogname, $blog_title, $errors, $domain, $path;
[408] Fix | Delete
$current_user = wp_get_current_user();
[409] Fix | Delete
if ( ! is_user_logged_in() ) {
[410] Fix | Delete
die();
[411] Fix | Delete
}
[412] Fix | Delete
[413] Fix | Delete
$result = validate_blog_form();
[414] Fix | Delete
[415] Fix | Delete
// Extracted values set/overwrite globals.
[416] Fix | Delete
$domain = $result['domain'];
[417] Fix | Delete
$path = $result['path'];
[418] Fix | Delete
$blogname = $result['blogname'];
[419] Fix | Delete
$blog_title = $result['blog_title'];
[420] Fix | Delete
$errors = $result['errors'];
[421] Fix | Delete
[422] Fix | Delete
if ( $errors->has_errors() ) {
[423] Fix | Delete
signup_another_blog( $blogname, $blog_title, $errors );
[424] Fix | Delete
return false;
[425] Fix | Delete
}
[426] Fix | Delete
[427] Fix | Delete
$public = (int) $_POST['blog_public'];
[428] Fix | Delete
[429] Fix | Delete
$blog_meta_defaults = array(
[430] Fix | Delete
'lang_id' => 1,
[431] Fix | Delete
'public' => $public,
[432] Fix | Delete
);
[433] Fix | Delete
[434] Fix | Delete
// Handle the language setting for the new site.
[435] Fix | Delete
if ( ! empty( $_POST['WPLANG'] ) ) {
[436] Fix | Delete
[437] Fix | Delete
$languages = signup_get_available_languages();
[438] Fix | Delete
[439] Fix | Delete
if ( in_array( $_POST['WPLANG'], $languages, true ) ) {
[440] Fix | Delete
$language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) );
[441] Fix | Delete
[442] Fix | Delete
if ( $language ) {
[443] Fix | Delete
$blog_meta_defaults['WPLANG'] = $language;
[444] Fix | Delete
}
[445] Fix | Delete
}
[446] Fix | Delete
}
[447] Fix | Delete
[448] Fix | Delete
/**
[449] Fix | Delete
* Filters the new site meta variables.
[450] Fix | Delete
*
[451] Fix | Delete
* Use the {@see 'add_signup_meta'} filter instead.
[452] Fix | Delete
*
[453] Fix | Delete
* @since MU (3.0.0)
[454] Fix | Delete
* @deprecated 3.0.0 Use the {@see 'add_signup_meta'} filter instead.
[455] Fix | Delete
*
[456] Fix | Delete
* @param array $blog_meta_defaults An array of default blog meta variables.
[457] Fix | Delete
*/
[458] Fix | Delete
$meta_defaults = apply_filters_deprecated( 'signup_create_blog_meta', array( $blog_meta_defaults ), '3.0.0', 'add_signup_meta' );
[459] Fix | Delete
[460] Fix | Delete
/**
[461] Fix | Delete
* Filters the new default site meta variables.
[462] Fix | Delete
*
[463] Fix | Delete
* @since 3.0.0
[464] Fix | Delete
*
[465] Fix | Delete
* @param array $meta {
[466] Fix | Delete
* An array of default site meta variables.
[467] Fix | Delete
*
[468] Fix | Delete
* @type int $lang_id The language ID.
[469] Fix | Delete
* @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false.
[470] Fix | Delete
* }
[471] Fix | Delete
*/
[472] Fix | Delete
$meta = apply_filters( 'add_signup_meta', $meta_defaults );
[473] Fix | Delete
[474] Fix | Delete
$blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, get_current_network_id() );
[475] Fix | Delete
[476] Fix | Delete
if ( is_wp_error( $blog_id ) ) {
[477] Fix | Delete
return false;
[478] Fix | Delete
}
[479] Fix | Delete
[480] Fix | Delete
confirm_another_blog_signup( $domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta, $blog_id );
[481] Fix | Delete
return true;
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
/**
[485] Fix | Delete
* Confirm a new site signup.
[486] Fix | Delete
*
[487] Fix | Delete
* @since MU (3.0.0)
[488] Fix | Delete
* @since 4.4.0 Added the `$blog_id` parameter.
[489] Fix | Delete
*
[490] Fix | Delete
* @param string $domain The domain URL.
[491] Fix | Delete
* @param string $path The site root path.
[492] Fix | Delete
* @param string $blog_title The site title.
[493] Fix | Delete
* @param string $user_name The username.
[494] Fix | Delete
* @param string $user_email The user's email address.
[495] Fix | Delete
* @param array $meta Any additional meta from the {@see 'add_signup_meta'} filter in validate_blog_signup().
[496] Fix | Delete
* @param int $blog_id The site ID.
[497] Fix | Delete
*/
[498] Fix | Delete
function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array(), $blog_id = 0 ) {
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function