• About WordPress
    • About WordPress
    • WordPress.org
    • Documentation
    • Support
    • Feedback
  • Log In
  • Register
WordPress.org
WordPress.org
  • Plugins
  • Themes
  • Patterns
  • Learn
  • Support
    • Documentation
    • Forums
  • News
  • About
  • Get Involved
    • Five for the Future
  • Showcase
  • Mobile
  • Hosting
  • Openverse
  • Get WordPress
Get WordPress

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Reference / Functions / validate_user_signup()

validate_user_signup()

Validates the new user sign-up.

Contents

  • Return
  • Source
  • Related
    • Uses
  • Changelog
  • User Contributed Notes

Return

(bool) True if new user sign-up was validated, false on error.


Top ↑

Source

File: wp-signup.php

function validate_user_signup() {
	$result     = validate_user_form();
	$user_name  = $result['user_name'];
	$user_email = $result['user_email'];
	$errors     = $result['errors'];

	if ( $errors->has_errors() ) {
		signup_user( $user_name, $user_email, $errors );
		return false;
	}

	if ( 'blog' === $_POST['signup_for'] ) {
		signup_blog( $user_name, $user_email );
		return false;
	}

	/** This filter is documented in wp-signup.php */
	wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) );

	confirm_user_signup( $user_name, $user_email );
	return true;
}

Expand full source code Collapse full source code View on Trac View on GitHub


Top ↑

Related

Top ↑

Uses

Uses
Uses Description
wp-signup.php: validate_user_form()

Validates user sign-up name and email.

wp-signup.php: signup_user()

Shows a form for a visitor to sign up for a new user account.

wp-signup.php: signup_blog()

Shows a form for a user or visitor to sign up for a new site.

wp-signup.php: confirm_user_signup()

Shows a message confirming that the new user has been registered and is awaiting activation.

wp-signup.php: add_signup_meta

Filters the new default site meta variables.

wp-includes/plugin.php: apply_filters()

Calls the callback functions that have been added to a filter hook.

wp-includes/ms-functions.php: wpmu_signup_user()

Records user signup information for future activation.

Show 2 more uses Hide more uses

Top ↑

Changelog

Changelog
Version Description
MU (3.0.0) Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.

  • About
  • News
  • Hosting
  • Donate
  • Support
  • Developers
  • Get Involved
  • Learn
  • Showcase
  • Plugins
  • Themes
  • Patterns
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • Privacy
  • Public Code
WordPress.org
WordPress.org
  • Visit our Facebook page
  • Visit our Twitter account
Code is Poetry

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.