signup_nonce_fields() WordPress Function

The signup_nonce_fields() function is used to protect against certain types of attacks on WordPress websites. It adds hidden fields to the signup form that contain a nonce, or number used once, which is used to verify the form submission. This function should be called when adding a new user to the website.

signup_nonce_fields() #

Adds a nonce field to the signup page.


Source

File: wp-includes/ms-functions.php

function signup_nonce_fields() {
	$id = mt_rand();
	echo "<input type='hidden' name='signup_form_id' value='{$id}' />";
	wp_nonce_field( 'signup_form_' . $id, '_signup_form', false );
}


Top ↑

Changelog

Changelog
VersionDescription
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More