wp_verify_nonce_failed
Action HookDescription
Fires when nonce verification fails.Hook Information
File Location |
wp-includes/pluggable.php
View on GitHub
|
Hook Type | Action |
Line Number | 2414 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$nonce
|
The invalid nonce. |
string|int
|
$action
|
The nonce action. |
WP_User
|
$user
|
The current user object. |
string
|
$token
|
The user's session token. |
Usage Examples
Basic Usage
<?php
// Hook into wp_verify_nonce_failed
add_action('wp_verify_nonce_failed', 'my_custom_function', 10, 4);
function my_custom_function($nonce, $action, $user, $token) {
// Your custom code here
}
Source Code Context
wp-includes/pluggable.php:2414
- How this hook is used in WordPress core
<?php
2409 * @param string $nonce The invalid nonce.
2410 * @param string|int $action The nonce action.
2411 * @param WP_User $user The current user object.
2412 * @param string $token The user's session token.
2413 */
2414 do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token );
2415
2416 // Invalid nonce.
2417 return false;
2418 }
2419 endif;
PHP Documentation
<?php
/**
* Fires when nonce verification fails.
*
* @since 4.4.0
*
* @param string $nonce The invalid nonce.
* @param string|int $action The nonce action.
* @param WP_User $user The current user object.
* @param string $token The user's session token.
*/
Quick Info
- Hook Type: Action
- Parameters: 4
- File: wp-includes/pluggable.php
Related Hooks
Related hooks will be displayed here in future updates.