validate_blog_signup

Validate new site signup.

Description

validate_blog_signup(); 

Usage

  1. if ( !function_exists( 'validate_blog_signup' ) ) { 
  2. require_once '/wp-signup.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = validate_blog_signup(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-signup.php  
  1. function validate_blog_signup() { 
  2. // Re-validate user info. 
  3. $user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] ); 
  4. $user_name = $user_result['user_name']; 
  5. $user_email = $user_result['user_email']; 
  6. $user_errors = $user_result['errors']; 
  7.  
  8. if ( $user_errors->get_error_code() ) { 
  9. signup_user( $user_name, $user_email, $user_errors ); 
  10. return false; 
  11.  
  12. $result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] ); 
  13. $domain = $result['domain']; 
  14. $path = $result['path']; 
  15. $blogname = $result['blogname']; 
  16. $blog_title = $result['blog_title']; 
  17. $errors = $result['errors']; 
  18.  
  19. if ( $errors->get_error_code() ) { 
  20. signup_blog($user_name, $user_email, $blogname, $blog_title, $errors); 
  21. return false; 
  22.  
  23. $public = (int) $_POST['blog_public']; 
  24. $signup_meta = array ('lang_id' => 1, 'public' => $public); 
  25.  
  26. // Handle the language setting for the new site. 
  27. if ( ! empty( $_POST['WPLANG'] ) ) { 
  28.  
  29.  
  30. if ( in_array( $_POST['WPLANG'], $languages ) ) { 
  31. $language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) ); 
  32.  
  33. if ( $language ) { 
  34. $signup_meta['WPLANG'] = $language; 
  35.  
  36.  
  37. /** This filter is documented in wp-signup.php */ 
  38. $meta = apply_filters( 'add_signup_meta', $signup_meta ); 
  39.  
  40. wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta); 
  41. confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta); 
  42. return true;