<form method="post">
<input type="hidden" id="wpf_nonce_field" name="wpf_nonce_field" value="1cfd4c0539" />
<input type="hidden" name="_wp_http_referer" value="/wp-trunk/contact/" />
Enter your name: <input type="text" name="text" /><br />
<input type="submit" name="submit" value="Save Options" />
</form>
<?php
/*
After your form is posted, the fi rst thing you need to do is check your nonce secret key using the wp _ verify _ nonce() function like so:
*/
if ( isset( $_POST['submit'] ) ) {
//check nonce for security
wp_verify_nonce( 'wpf_settings_form_save', 'wpf_nonce_field' );
//nonce passed, now do stuff
}
// Verifying that the nonce is valid is as simple as calling the wp _ verify _ nonce() function
/*
Nonces can also be used on links that perform actions. To create a URL nonce, you use the wp _ nonce _ url() function. This can be used in conjunction with multiple query strings in your URL like so:
*/
$link = 'my-url.php?action=delete&ID=15';
?>
<a href="<?php echo wp_nonce_url( $link, 'wpf_delete_action', 'wpf_nonce_url_check' ); ?>">Delete</a>