Skip to content
  • Log In
  • Register
WordPress.org
  • News
  • Download & Extend
    • Get WordPress
    • Themes
    • Patterns
    • Plugins
    • Openverse
    • Mobile
    • Hosting
  • Learn
    • Learn WordPress
    • Documentation
    • Forums
    • WordPress.tv
    • Developers
  • Community
    • Make WordPress
    • WordCamp
    • Meetups
    • Photo Directory
    • Job Board
    • Five for the Future
  • About
    • About WordPress
    • Showcase
    • Gutenberg
    • Enterprise
    • WordPress Swag Store
  • Get WordPress
Get WordPress

Developer Resources

Browse: Home / Reference / Functions / validate_user_signup()

validate_user_signup(): bool

Validates the new user sign-up.

Contents

  • Return
  • Source
  • Hooks
  • 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. View all references

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;
}

View on Trac View on GitHub


Top ↑

Hooks

apply_filters( 'add_signup_meta', array $meta )

Filters the new default site meta variables.


Top ↑

Related

Top ↑

Uses

Uses
Uses Description
validate_user_form() wp-signup.php

Validates user sign-up name and email.

signup_user() wp-signup.php

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

signup_blog() wp-signup.php

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

confirm_user_signup() wp-signup.php

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

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

Records user signup information for future activation.

apply_filters() wp-includes/plugin.php

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

Show 1 more use 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
  • Swag
  • Documentation
  • 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
  • Visit our Instagram account
  • Visit our LinkedIn 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.