From 1f4ae40c03c027daa6e2b11bf749247f82f0d0fc Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 26 Aug 2015 00:06:21 +0000 Subject: [PATCH] Add `'wp_verify_nonce_failed'` action that fires when nonce verification fails. props johnbillion, garza, Shelob9. fixes #24030. Built from https://develop.svn.wordpress.org/trunk@33744 git-svn-id: http://core.svn.wordpress.org/trunk@33712 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 12 ++++++++++++ wp-includes/version.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 1256431438..643fc24c5d 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1812,6 +1812,18 @@ function wp_verify_nonce( $nonce, $action = -1 ) { return 2; } + /** + * 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. + */ + do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token ); + // Invalid nonce return false; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 39025f0412..2166d20a65 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-33743'; +$wp_version = '4.4-alpha-33744'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.