Eliminate use of `extract()` in `validate_blog_signup()`:
* `$orig_username` does not need to be pulled from `wpmu_validate_user_signup()` as it is not used in this function. * `$user` does not need to be pulled from `wpmu_validate_blog_signup()` as it is not used in this function. * For the `wpmu_validate_user_signup()` portion, rename `$result` and `$errors` to $user_result` and `$user_errors` for disambiguation with the blog values below. See #22400. Built from https://develop.svn.wordpress.org/trunk@28447 git-svn-id: http://core.svn.wordpress.org/trunk@28274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bb810c5352
commit
82d6b94cfe
|
@ -475,7 +475,7 @@ function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
|
|||
function validate_user_signup() {
|
||||
$result = validate_user_form();
|
||||
$user_name = $result['user_name'];
|
||||
$user_email = $result['user_email'];
|
||||
$user_email = $result['user_email'];
|
||||
$errors = $result['errors'];
|
||||
|
||||
if ( $errors->get_error_code() ) {
|
||||
|
@ -593,16 +593,22 @@ function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_ti
|
|||
*/
|
||||
function validate_blog_signup() {
|
||||
// Re-validate user info.
|
||||
$result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
|
||||
extract($result);
|
||||
$user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );
|
||||
$user_name = $user_result['user_name'];
|
||||
$user_email = $user_result['user_email'];
|
||||
$user_errors = $user_result['errors'];
|
||||
|
||||
if ( $errors->get_error_code() ) {
|
||||
signup_user($user_name, $user_email, $errors);
|
||||
if ( $user_errors->get_error_code() ) {
|
||||
signup_user( $user_name, $user_email, $user_errors );
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title']);
|
||||
extract($result);
|
||||
$result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] );
|
||||
$domain = $result['domain'];
|
||||
$path = $result['path'];
|
||||
$blogname = $result['blogname'];
|
||||
$blog_title = $result['blog_title'];
|
||||
$errors = $result['errors'];
|
||||
|
||||
if ( $errors->get_error_code() ) {
|
||||
signup_blog($user_name, $user_email, $blogname, $blog_title, $errors);
|
||||
|
@ -610,10 +616,10 @@ function validate_blog_signup() {
|
|||
}
|
||||
|
||||
$public = (int) $_POST['blog_public'];
|
||||
$meta = array ('lang_id' => 1, 'public' => $public);
|
||||
$signup_meta = array ('lang_id' => 1, 'public' => $public);
|
||||
|
||||
/** This filter is documented in wp-signup.php */
|
||||
$meta = apply_filters( 'add_signup_meta', $meta );
|
||||
$meta = apply_filters( 'add_signup_meta', $signup_meta );
|
||||
|
||||
wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
|
||||
confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta);
|
||||
|
|
Loading…
Reference in New Issue