WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/wpmu validate user signup

Description

Validates the passed username and email address against set criteria (listed below).

Parameters

$user_name
( string ) (required) The username to be validated.
Default: None
$user_email
( string ) (required) The email address to be validated.
Default: None

Validation

Username

The function validates that the username...

  • Is already in use
  • Is at least 4 characters long
  • Is not empty
  • Is lowercase
  • Is alphanumeric (contains numbers and letters)
    • It cannot be numeric only (is not only numbers)
    • Does not contain an underscore (the "_" character)
  • Does not contain illegal names defined in Site Admin -> Options
    Defaults: "www", "web", "root", "admin", "main", "invite", "administrator"

Email address

The function validates that the email address...

  • Is already in use
  • Is a valid email address (x@x.xx)
  • Is not listed as unsafe (by is_email_address_unsafe() ).

Return Values

(WP_Error) 
Instance of WP_Error with error codes and messages inside.

Usage

<?php wpmu_validate_user_signup($user_name$user_email); ?>