Edit File by line
/home/barbar84/www
File: wp-signup.php
[500] Fix | Delete
if ( $blog_id ) {
[501] Fix | Delete
switch_to_blog( $blog_id );
[502] Fix | Delete
$home_url = home_url( '/' );
[503] Fix | Delete
$login_url = wp_login_url();
[504] Fix | Delete
restore_current_blog();
[505] Fix | Delete
} else {
[506] Fix | Delete
$home_url = 'http://' . $domain . $path;
[507] Fix | Delete
$login_url = 'http://' . $domain . $path . 'wp-login.php';
[508] Fix | Delete
}
[509] Fix | Delete
[510] Fix | Delete
$site = sprintf(
[511] Fix | Delete
'<a href="%1$s">%2$s</a>',
[512] Fix | Delete
esc_url( $home_url ),
[513] Fix | Delete
$blog_title
[514] Fix | Delete
);
[515] Fix | Delete
[516] Fix | Delete
?>
[517] Fix | Delete
<h2>
[518] Fix | Delete
<?php
[519] Fix | Delete
/* translators: %s: Site title. */
[520] Fix | Delete
printf( __( 'The site %s is yours.' ), $site );
[521] Fix | Delete
?>
[522] Fix | Delete
</h2>
[523] Fix | Delete
<p>
[524] Fix | Delete
<?php
[525] Fix | Delete
printf(
[526] Fix | Delete
/* translators: 1: Link to new site, 2: Login URL, 3: Username. */
[527] Fix | Delete
__( '%1$s is your new site. <a href="%2$s">Log in</a> as &#8220;%3$s&#8221; using your existing password.' ),
[528] Fix | Delete
sprintf(
[529] Fix | Delete
'<a href="%s">%s</a>',
[530] Fix | Delete
esc_url( $home_url ),
[531] Fix | Delete
untrailingslashit( $domain . $path )
[532] Fix | Delete
),
[533] Fix | Delete
esc_url( $login_url ),
[534] Fix | Delete
$user_name
[535] Fix | Delete
);
[536] Fix | Delete
?>
[537] Fix | Delete
</p>
[538] Fix | Delete
<?php
[539] Fix | Delete
/**
[540] Fix | Delete
* Fires when the site or user sign-up process is complete.
[541] Fix | Delete
*
[542] Fix | Delete
* @since 3.0.0
[543] Fix | Delete
*/
[544] Fix | Delete
do_action( 'signup_finished' );
[545] Fix | Delete
}
[546] Fix | Delete
[547] Fix | Delete
/**
[548] Fix | Delete
* Shows a form for a visitor to sign up for a new user account.
[549] Fix | Delete
*
[550] Fix | Delete
* @since MU (3.0.0)
[551] Fix | Delete
*
[552] Fix | Delete
* @param string $user_name The username.
[553] Fix | Delete
* @param string $user_email The user's email.
[554] Fix | Delete
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string.
[555] Fix | Delete
*/
[556] Fix | Delete
function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
[557] Fix | Delete
global $active_signup;
[558] Fix | Delete
[559] Fix | Delete
if ( ! is_wp_error( $errors ) ) {
[560] Fix | Delete
$errors = new WP_Error();
[561] Fix | Delete
}
[562] Fix | Delete
[563] Fix | Delete
$signup_for = isset( $_POST['signup_for'] ) ? esc_html( $_POST['signup_for'] ) : 'blog';
[564] Fix | Delete
[565] Fix | Delete
$signup_user_defaults = array(
[566] Fix | Delete
'user_name' => $user_name,
[567] Fix | Delete
'user_email' => $user_email,
[568] Fix | Delete
'errors' => $errors,
[569] Fix | Delete
);
[570] Fix | Delete
[571] Fix | Delete
/**
[572] Fix | Delete
* Filters the default user variables used on the user sign-up form.
[573] Fix | Delete
*
[574] Fix | Delete
* @since 3.0.0
[575] Fix | Delete
*
[576] Fix | Delete
* @param array $signup_user_defaults {
[577] Fix | Delete
* An array of default user variables.
[578] Fix | Delete
*
[579] Fix | Delete
* @type string $user_name The user username.
[580] Fix | Delete
* @type string $user_email The user email address.
[581] Fix | Delete
* @type WP_Error $errors A WP_Error object with possible errors relevant to the sign-up user.
[582] Fix | Delete
* }
[583] Fix | Delete
*/
[584] Fix | Delete
$filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults );
[585] Fix | Delete
$user_name = $filtered_results['user_name'];
[586] Fix | Delete
$user_email = $filtered_results['user_email'];
[587] Fix | Delete
$errors = $filtered_results['errors'];
[588] Fix | Delete
[589] Fix | Delete
?>
[590] Fix | Delete
[591] Fix | Delete
<h2>
[592] Fix | Delete
<?php
[593] Fix | Delete
/* translators: %s: Name of the network. */
[594] Fix | Delete
printf( __( 'Get your own %s account in seconds' ), get_network()->site_name );
[595] Fix | Delete
?>
[596] Fix | Delete
</h2>
[597] Fix | Delete
<form id="setupform" method="post" action="wp-signup.php" novalidate="novalidate">
[598] Fix | Delete
<input type="hidden" name="stage" value="validate-user-signup" />
[599] Fix | Delete
<?php
[600] Fix | Delete
/** This action is documented in wp-signup.php */
[601] Fix | Delete
do_action( 'signup_hidden_fields', 'validate-user' );
[602] Fix | Delete
?>
[603] Fix | Delete
<?php show_user_form( $user_name, $user_email, $errors ); ?>
[604] Fix | Delete
[605] Fix | Delete
<p>
[606] Fix | Delete
<?php if ( 'blog' === $active_signup ) { ?>
[607] Fix | Delete
<input id="signupblog" type="hidden" name="signup_for" value="blog" />
[608] Fix | Delete
<?php } elseif ( 'user' === $active_signup ) { ?>
[609] Fix | Delete
<input id="signupblog" type="hidden" name="signup_for" value="user" />
[610] Fix | Delete
<?php } else { ?>
[611] Fix | Delete
<input id="signupblog" type="radio" name="signup_for" value="blog" <?php checked( $signup_for, 'blog' ); ?> />
[612] Fix | Delete
<label class="checkbox" for="signupblog"><?php _e( 'Gimme a site!' ); ?></label>
[613] Fix | Delete
<br />
[614] Fix | Delete
<input id="signupuser" type="radio" name="signup_for" value="user" <?php checked( $signup_for, 'user' ); ?> />
[615] Fix | Delete
<label class="checkbox" for="signupuser"><?php _e( 'Just a username, please.' ); ?></label>
[616] Fix | Delete
<?php } ?>
[617] Fix | Delete
</p>
[618] Fix | Delete
[619] Fix | Delete
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Next' ); ?>" /></p>
[620] Fix | Delete
</form>
[621] Fix | Delete
<?php
[622] Fix | Delete
}
[623] Fix | Delete
[624] Fix | Delete
/**
[625] Fix | Delete
* Validate the new user signup
[626] Fix | Delete
*
[627] Fix | Delete
* @since MU (3.0.0)
[628] Fix | Delete
*
[629] Fix | Delete
* @return bool True if new user signup was validated, false if error
[630] Fix | Delete
*/
[631] Fix | Delete
function validate_user_signup() {
[632] Fix | Delete
$result = validate_user_form();
[633] Fix | Delete
$user_name = $result['user_name'];
[634] Fix | Delete
$user_email = $result['user_email'];
[635] Fix | Delete
$errors = $result['errors'];
[636] Fix | Delete
[637] Fix | Delete
if ( $errors->has_errors() ) {
[638] Fix | Delete
signup_user( $user_name, $user_email, $errors );
[639] Fix | Delete
return false;
[640] Fix | Delete
}
[641] Fix | Delete
[642] Fix | Delete
if ( 'blog' === $_POST['signup_for'] ) {
[643] Fix | Delete
signup_blog( $user_name, $user_email );
[644] Fix | Delete
return false;
[645] Fix | Delete
}
[646] Fix | Delete
[647] Fix | Delete
/** This filter is documented in wp-signup.php */
[648] Fix | Delete
wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) );
[649] Fix | Delete
[650] Fix | Delete
confirm_user_signup( $user_name, $user_email );
[651] Fix | Delete
return true;
[652] Fix | Delete
}
[653] Fix | Delete
[654] Fix | Delete
/**
[655] Fix | Delete
* New user signup confirmation
[656] Fix | Delete
*
[657] Fix | Delete
* @since MU (3.0.0)
[658] Fix | Delete
*
[659] Fix | Delete
* @param string $user_name The username
[660] Fix | Delete
* @param string $user_email The user's email address
[661] Fix | Delete
*/
[662] Fix | Delete
function confirm_user_signup( $user_name, $user_email ) {
[663] Fix | Delete
?>
[664] Fix | Delete
<h2>
[665] Fix | Delete
<?php
[666] Fix | Delete
/* translators: %s: Username. */
[667] Fix | Delete
printf( __( '%s is your new username' ), $user_name )
[668] Fix | Delete
?>
[669] Fix | Delete
</h2>
[670] Fix | Delete
<p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ); ?></p>
[671] Fix | Delete
<p>
[672] Fix | Delete
<?php
[673] Fix | Delete
/* translators: %s: Email address. */
[674] Fix | Delete
printf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' );
[675] Fix | Delete
?>
[676] Fix | Delete
</p>
[677] Fix | Delete
<p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p>
[678] Fix | Delete
<?php
[679] Fix | Delete
/** This action is documented in wp-signup.php */
[680] Fix | Delete
do_action( 'signup_finished' );
[681] Fix | Delete
}
[682] Fix | Delete
[683] Fix | Delete
/**
[684] Fix | Delete
* Shows a form for a user or visitor to sign up for a new site.
[685] Fix | Delete
*
[686] Fix | Delete
* @since MU (3.0.0)
[687] Fix | Delete
*
[688] Fix | Delete
* @param string $user_name The username.
[689] Fix | Delete
* @param string $user_email The user's email address.
[690] Fix | Delete
* @param string $blogname The site name.
[691] Fix | Delete
* @param string $blog_title The site title.
[692] Fix | Delete
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string.
[693] Fix | Delete
*/
[694] Fix | Delete
function signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '' ) {
[695] Fix | Delete
if ( ! is_wp_error( $errors ) ) {
[696] Fix | Delete
$errors = new WP_Error();
[697] Fix | Delete
}
[698] Fix | Delete
[699] Fix | Delete
$signup_blog_defaults = array(
[700] Fix | Delete
'user_name' => $user_name,
[701] Fix | Delete
'user_email' => $user_email,
[702] Fix | Delete
'blogname' => $blogname,
[703] Fix | Delete
'blog_title' => $blog_title,
[704] Fix | Delete
'errors' => $errors,
[705] Fix | Delete
);
[706] Fix | Delete
[707] Fix | Delete
/**
[708] Fix | Delete
* Filters the default site creation variables for the site sign-up form.
[709] Fix | Delete
*
[710] Fix | Delete
* @since 3.0.0
[711] Fix | Delete
*
[712] Fix | Delete
* @param array $signup_blog_defaults {
[713] Fix | Delete
* An array of default site creation variables.
[714] Fix | Delete
*
[715] Fix | Delete
* @type string $user_name The user username.
[716] Fix | Delete
* @type string $user_email The user email address.
[717] Fix | Delete
* @type string $blogname The blogname.
[718] Fix | Delete
* @type string $blog_title The title of the site.
[719] Fix | Delete
* @type WP_Error $errors A WP_Error object with possible errors relevant to new site creation variables.
[720] Fix | Delete
* }
[721] Fix | Delete
*/
[722] Fix | Delete
$filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );
[723] Fix | Delete
[724] Fix | Delete
$user_name = $filtered_results['user_name'];
[725] Fix | Delete
$user_email = $filtered_results['user_email'];
[726] Fix | Delete
$blogname = $filtered_results['blogname'];
[727] Fix | Delete
$blog_title = $filtered_results['blog_title'];
[728] Fix | Delete
$errors = $filtered_results['errors'];
[729] Fix | Delete
[730] Fix | Delete
if ( empty( $blogname ) ) {
[731] Fix | Delete
$blogname = $user_name;
[732] Fix | Delete
}
[733] Fix | Delete
?>
[734] Fix | Delete
<form id="setupform" method="post" action="wp-signup.php">
[735] Fix | Delete
<input type="hidden" name="stage" value="validate-blog-signup" />
[736] Fix | Delete
<input type="hidden" name="user_name" value="<?php echo esc_attr( $user_name ); ?>" />
[737] Fix | Delete
<input type="hidden" name="user_email" value="<?php echo esc_attr( $user_email ); ?>" />
[738] Fix | Delete
<?php
[739] Fix | Delete
/** This action is documented in wp-signup.php */
[740] Fix | Delete
do_action( 'signup_hidden_fields', 'validate-site' );
[741] Fix | Delete
?>
[742] Fix | Delete
<?php show_blog_form( $blogname, $blog_title, $errors ); ?>
[743] Fix | Delete
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Signup' ); ?>" /></p>
[744] Fix | Delete
</form>
[745] Fix | Delete
<?php
[746] Fix | Delete
}
[747] Fix | Delete
[748] Fix | Delete
/**
[749] Fix | Delete
* Validate new site signup
[750] Fix | Delete
*
[751] Fix | Delete
* @since MU (3.0.0)
[752] Fix | Delete
*
[753] Fix | Delete
* @return bool True if the site signup was validated, false if error
[754] Fix | Delete
*/
[755] Fix | Delete
function validate_blog_signup() {
[756] Fix | Delete
// Re-validate user info.
[757] Fix | Delete
$user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );
[758] Fix | Delete
$user_name = $user_result['user_name'];
[759] Fix | Delete
$user_email = $user_result['user_email'];
[760] Fix | Delete
$user_errors = $user_result['errors'];
[761] Fix | Delete
[762] Fix | Delete
if ( $user_errors->has_errors() ) {
[763] Fix | Delete
signup_user( $user_name, $user_email, $user_errors );
[764] Fix | Delete
return false;
[765] Fix | Delete
}
[766] Fix | Delete
[767] Fix | Delete
$result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] );
[768] Fix | Delete
$domain = $result['domain'];
[769] Fix | Delete
$path = $result['path'];
[770] Fix | Delete
$blogname = $result['blogname'];
[771] Fix | Delete
$blog_title = $result['blog_title'];
[772] Fix | Delete
$errors = $result['errors'];
[773] Fix | Delete
[774] Fix | Delete
if ( $errors->has_errors() ) {
[775] Fix | Delete
signup_blog( $user_name, $user_email, $blogname, $blog_title, $errors );
[776] Fix | Delete
return false;
[777] Fix | Delete
}
[778] Fix | Delete
[779] Fix | Delete
$public = (int) $_POST['blog_public'];
[780] Fix | Delete
$signup_meta = array(
[781] Fix | Delete
'lang_id' => 1,
[782] Fix | Delete
'public' => $public,
[783] Fix | Delete
);
[784] Fix | Delete
[785] Fix | Delete
// Handle the language setting for the new site.
[786] Fix | Delete
if ( ! empty( $_POST['WPLANG'] ) ) {
[787] Fix | Delete
[788] Fix | Delete
$languages = signup_get_available_languages();
[789] Fix | Delete
[790] Fix | Delete
if ( in_array( $_POST['WPLANG'], $languages, true ) ) {
[791] Fix | Delete
$language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) );
[792] Fix | Delete
[793] Fix | Delete
if ( $language ) {
[794] Fix | Delete
$signup_meta['WPLANG'] = $language;
[795] Fix | Delete
}
[796] Fix | Delete
}
[797] Fix | Delete
}
[798] Fix | Delete
[799] Fix | Delete
/** This filter is documented in wp-signup.php */
[800] Fix | Delete
$meta = apply_filters( 'add_signup_meta', $signup_meta );
[801] Fix | Delete
[802] Fix | Delete
wpmu_signup_blog( $domain, $path, $blog_title, $user_name, $user_email, $meta );
[803] Fix | Delete
confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email, $meta );
[804] Fix | Delete
return true;
[805] Fix | Delete
}
[806] Fix | Delete
[807] Fix | Delete
/**
[808] Fix | Delete
* Shows a message confirming that the new site has been registered and is awaiting activation.
[809] Fix | Delete
*
[810] Fix | Delete
* @since MU (3.0.0)
[811] Fix | Delete
*
[812] Fix | Delete
* @param string $domain The domain or subdomain of the site.
[813] Fix | Delete
* @param string $path The path of the site.
[814] Fix | Delete
* @param string $blog_title The title of the new site.
[815] Fix | Delete
* @param string $user_name The user's username.
[816] Fix | Delete
* @param string $user_email The user's email address.
[817] Fix | Delete
* @param array $meta Any additional meta from the {@see 'add_signup_meta'} filter in validate_blog_signup().
[818] Fix | Delete
*/
[819] Fix | Delete
function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
[820] Fix | Delete
?>
[821] Fix | Delete
<h2>
[822] Fix | Delete
<?php
[823] Fix | Delete
/* translators: %s: Site address. */
[824] Fix | Delete
printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" )
[825] Fix | Delete
?>
[826] Fix | Delete
</h2>
[827] Fix | Delete
[828] Fix | Delete
<p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ); ?></p>
[829] Fix | Delete
<p>
[830] Fix | Delete
<?php
[831] Fix | Delete
/* translators: %s: Email address. */
[832] Fix | Delete
printf( __( 'Check your inbox at %s and click the link given.' ), '<strong>' . $user_email . '</strong>' );
[833] Fix | Delete
?>
[834] Fix | Delete
</p>
[835] Fix | Delete
<p><?php _e( 'If you do not activate your site within two days, you will have to sign up again.' ); ?></p>
[836] Fix | Delete
<h2><?php _e( 'Still waiting for your email?' ); ?></h2>
[837] Fix | Delete
<p>
[838] Fix | Delete
<?php _e( 'If you haven&#8217;t received your email yet, there are a number of things you can do:' ); ?>
[839] Fix | Delete
<ul id="noemail-tips">
[840] Fix | Delete
<li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ); ?></strong></p></li>
[841] Fix | Delete
<li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ); ?></p></li>
[842] Fix | Delete
<li>
[843] Fix | Delete
<?php
[844] Fix | Delete
/* translators: %s: Email address. */
[845] Fix | Delete
printf( __( 'Have you entered your email correctly? You have entered %s, if it&#8217;s incorrect, you will not receive your email.' ), $user_email );
[846] Fix | Delete
?>
[847] Fix | Delete
</li>
[848] Fix | Delete
</ul>
[849] Fix | Delete
</p>
[850] Fix | Delete
<?php
[851] Fix | Delete
/** This action is documented in wp-signup.php */
[852] Fix | Delete
do_action( 'signup_finished' );
[853] Fix | Delete
}
[854] Fix | Delete
[855] Fix | Delete
/**
[856] Fix | Delete
* Retrieves languages available during the site/user signup process.
[857] Fix | Delete
*
[858] Fix | Delete
* @since 4.4.0
[859] Fix | Delete
*
[860] Fix | Delete
* @see get_available_languages()
[861] Fix | Delete
*
[862] Fix | Delete
* @return array List of available languages.
[863] Fix | Delete
*/
[864] Fix | Delete
function signup_get_available_languages() {
[865] Fix | Delete
/**
[866] Fix | Delete
* Filters the list of available languages for front-end site signups.
[867] Fix | Delete
*
[868] Fix | Delete
* Passing an empty array to this hook will disable output of the setting on the
[869] Fix | Delete
* signup form, and the default language will be used when creating the site.
[870] Fix | Delete
*
[871] Fix | Delete
* Languages not already installed will be stripped.
[872] Fix | Delete
*
[873] Fix | Delete
* @since 4.4.0
[874] Fix | Delete
*
[875] Fix | Delete
* @param array $available_languages Available languages.
[876] Fix | Delete
*/
[877] Fix | Delete
$languages = (array) apply_filters( 'signup_get_available_languages', get_available_languages() );
[878] Fix | Delete
[879] Fix | Delete
/*
[880] Fix | Delete
* Strip any non-installed languages and return.
[881] Fix | Delete
*
[882] Fix | Delete
* Re-call get_available_languages() here in case a language pack was installed
[883] Fix | Delete
* in a callback hooked to the 'signup_get_available_languages' filter before this point.
[884] Fix | Delete
*/
[885] Fix | Delete
return array_intersect_assoc( $languages, get_available_languages() );
[886] Fix | Delete
}
[887] Fix | Delete
[888] Fix | Delete
// Main.
[889] Fix | Delete
$active_signup = get_site_option( 'registration', 'none' );
[890] Fix | Delete
[891] Fix | Delete
/**
[892] Fix | Delete
* Filters the type of site sign-up.
[893] Fix | Delete
*
[894] Fix | Delete
* @since 3.0.0
[895] Fix | Delete
*
[896] Fix | Delete
* @param string $active_signup String that returns registration type. The value can be
[897] Fix | Delete
* 'all', 'none', 'blog', or 'user'.
[898] Fix | Delete
*/
[899] Fix | Delete
$active_signup = apply_filters( 'wpmu_active_signup', $active_signup );
[900] Fix | Delete
[901] Fix | Delete
if ( current_user_can( 'manage_network' ) ) {
[902] Fix | Delete
echo '<div class="mu_alert">';
[903] Fix | Delete
_e( 'Greetings Network Administrator!' );
[904] Fix | Delete
echo ' ';
[905] Fix | Delete
[906] Fix | Delete
switch ( $active_signup ) {
[907] Fix | Delete
case 'none':
[908] Fix | Delete
_e( 'The network currently disallows registrations.' );
[909] Fix | Delete
break;
[910] Fix | Delete
case 'blog':
[911] Fix | Delete
_e( 'The network currently allows site registrations.' );
[912] Fix | Delete
break;
[913] Fix | Delete
case 'user':
[914] Fix | Delete
_e( 'The network currently allows user registrations.' );
[915] Fix | Delete
break;
[916] Fix | Delete
default:
[917] Fix | Delete
_e( 'The network currently allows both site and user registrations.' );
[918] Fix | Delete
break;
[919] Fix | Delete
}
[920] Fix | Delete
[921] Fix | Delete
echo ' ';
[922] Fix | Delete
[923] Fix | Delete
/* translators: %s: URL to Network Settings screen. */
[924] Fix | Delete
printf( __( 'To change or disable registration go to your <a href="%s">Options page</a>.' ), esc_url( network_admin_url( 'settings.php' ) ) );
[925] Fix | Delete
echo '</div>';
[926] Fix | Delete
}
[927] Fix | Delete
[928] Fix | Delete
$newblogname = isset( $_GET['new'] ) ? strtolower( preg_replace( '/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'] ) ) : null;
[929] Fix | Delete
[930] Fix | Delete
$current_user = wp_get_current_user();
[931] Fix | Delete
if ( 'none' === $active_signup ) {
[932] Fix | Delete
_e( 'Registration has been disabled.' );
[933] Fix | Delete
} elseif ( 'blog' === $active_signup && ! is_user_logged_in() ) {
[934] Fix | Delete
$login_url = wp_login_url( network_site_url( 'wp-signup.php' ) );
[935] Fix | Delete
/* translators: %s: Login URL. */
[936] Fix | Delete
printf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url );
[937] Fix | Delete
} else {
[938] Fix | Delete
$stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default';
[939] Fix | Delete
switch ( $stage ) {
[940] Fix | Delete
case 'validate-user-signup':
[941] Fix | Delete
if ( 'all' === $active_signup
[942] Fix | Delete
|| ( 'blog' === $_POST['signup_for'] && 'blog' === $active_signup )
[943] Fix | Delete
|| ( 'user' === $_POST['signup_for'] && 'user' === $active_signup )
[944] Fix | Delete
) {
[945] Fix | Delete
validate_user_signup();
[946] Fix | Delete
} else {
[947] Fix | Delete
_e( 'User registration has been disabled.' );
[948] Fix | Delete
}
[949] Fix | Delete
break;
[950] Fix | Delete
case 'validate-blog-signup':
[951] Fix | Delete
if ( 'all' === $active_signup || 'blog' === $active_signup ) {
[952] Fix | Delete
validate_blog_signup();
[953] Fix | Delete
} else {
[954] Fix | Delete
_e( 'Site registration has been disabled.' );
[955] Fix | Delete
}
[956] Fix | Delete
break;
[957] Fix | Delete
case 'gimmeanotherblog':
[958] Fix | Delete
validate_another_blog_signup();
[959] Fix | Delete
break;
[960] Fix | Delete
case 'default':
[961] Fix | Delete
default:
[962] Fix | Delete
$user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : '';
[963] Fix | Delete
/**
[964] Fix | Delete
* Fires when the site sign-up form is sent.
[965] Fix | Delete
*
[966] Fix | Delete
* @since 3.0.0
[967] Fix | Delete
*/
[968] Fix | Delete
do_action( 'preprocess_signup_form' );
[969] Fix | Delete
if ( is_user_logged_in() && ( 'all' === $active_signup || 'blog' === $active_signup ) ) {
[970] Fix | Delete
signup_another_blog( $newblogname );
[971] Fix | Delete
} elseif ( ! is_user_logged_in() && ( 'all' === $active_signup || 'user' === $active_signup ) ) {
[972] Fix | Delete
signup_user( $newblogname, $user_email );
[973] Fix | Delete
} elseif ( ! is_user_logged_in() && ( 'blog' === $active_signup ) ) {
[974] Fix | Delete
_e( 'Sorry, new registrations are not allowed at this time.' );
[975] Fix | Delete
} else {
[976] Fix | Delete
_e( 'You are logged in already. No need to register again!' );
[977] Fix | Delete
}
[978] Fix | Delete
[979] Fix | Delete
if ( $newblogname ) {
[980] Fix | Delete
$newblog = get_blogaddress_by_name( $newblogname );
[981] Fix | Delete
[982] Fix | Delete
if ( 'blog' === $active_signup || 'all' === $active_signup ) {
[983] Fix | Delete
printf(
[984] Fix | Delete
/* translators: %s: Site address. */
[985] Fix | Delete
'<p>' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '</p>',
[986] Fix | Delete
'<strong>' . $newblog . '</strong>'
[987] Fix | Delete
);
[988] Fix | Delete
} else {
[989] Fix | Delete
printf(
[990] Fix | Delete
/* translators: %s: Site address. */
[991] Fix | Delete
'<p>' . __( 'The site you were looking for, %s, does not exist.' ) . '</p>',
[992] Fix | Delete
'<strong>' . $newblog . '</strong>'
[993] Fix | Delete
);
[994] Fix | Delete
}
[995] Fix | Delete
}
[996] Fix | Delete
break;
[997] Fix | Delete
}
[998] Fix | Delete
}
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function