}
/**
- * Processes new user registrations.
+ * Sanitize and validate data required for a user sign-up.
*
- * Checks the data provided by the user during signup. Verifies
- * the validity and uniqueness of user names and user email addresses,
- * and checks email addresses against admin-provided domain
- * whitelists and blacklists.
+ * Verifies the validity and uniqueness of user names and user email addresses,
+ * and checks email addresses against admin-provided domain whitelists and blacklists.
*
- * The hook 'wpmu_validate_user_signup' provides an easy way
- * to modify the signup process. The value $result, which is passed
- * to the hook, contains both the user-provided info and the error
- * messages created by the function. 'wpmu_validate_user_signup' allows
- * you to process the data in any way you'd like, and unset the
- * relevant errors if necessary.
+ * The {@see 'wpmu_validate_user_signup'} hook provides an easy way to modify the sign-up
+ * process. The value $result, which is passed to the hook, contains both the user-provided
+ * info and the error messages created by the function. {@see 'wpmu_validate_user_signup'}
+ * allows you to process the data in any way you'd like, and unset the relevant errors if
+ * necessary.
*
* @since MU
*
- * @param string $user_name The login name provided by the user.
+ * @param string $user_name The login name provided by the user.
* @param string $user_email The email provided by the user.
* @return array Contains username, email, and error messages.
*/
$welcome_email = get_site_option( 'welcome_email' );
if ( $welcome_email == false )
- $welcome_email = __( 'Dear User,
+ $welcome_email = __( 'Howdy USERNAME,
Your new SITE_NAME site has been successfully set up at:
BLOG_URL
$global_id = $wpdb->insert_id;
}
} elseif ( $global_id != $term_id ) {
- $local_id = $wpdb->get_row( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) );
- if ( null != $local_id )
- $local_id = global_terms( $local_id );
- if ( 10 < $global_terms_recurse )
+ $local_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) );
+ if ( null != $local_id ) {
+ global_terms( $local_id );
+ if ( 10 < $global_terms_recurse ) {
$global_id = $term_id;
+ }
+ }
}
if ( $global_id != $term_id ) {
if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) )
wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), home_url() ) );
- wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress › Success' ) );
+ wp_die( sprintf( __( 'You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">log in</a> using your username and password.' ), home_url(), admin_url() ), __( 'WordPress › Success' ), array( 'response' => 200 ) );
}
/**
* @return bool
*/
function is_user_spammy( $user = null ) {
- if ( ! is_a( $user, 'WP_User' ) ) {
- if ( $user )
+ if ( ! ( $user instanceof WP_User ) ) {
+ if ( $user ) {
$user = get_user_by( 'login', $user );
- else
+ } else {
$user = wp_get_current_user();
+ }
}
return $user && isset( $user->spam ) && 1 == $user->spam;
function update_blog_public( $old_value, $value ) {
update_blog_status( get_current_blog_id(), 'public', (int) $value );
}
-add_action('update_option_blog_public', 'update_blog_public', 10, 2);
/**
* Check whether a usermeta key has to do with the current blog.
return false;
}
-add_filter('option_users_can_register', 'users_can_register_signup_filter');
/**
* Ensure that the welcome message is not empty. Currently unused.
function welcome_user_msg_filter( $text ) {
if ( !$text ) {
remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
- $text = __( 'Dear User,
+ $text = __( 'Howdy USERNAME,
Your new account is set up.
}
return $text;
}
-add_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
/**
* Whether to force SSL on content.