check_admin_referer WordPress Action Hook

The check_admin_referer hook is used to verify that a user has permission to perform an action in the WordPress admin. This is typically used to prevent unauthorized access to admin pages or to perform actions that require elevated privileges.

do_action( 'check_admin_referer', string $action, false|int $result ) #

Fires once the admin request has been validated or not.


Parameters

$action

(string)The nonce action.

$result

(false|int)False if the nonce is invalid, 1 if the nonce is valid and generated between 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.


Top ↑

More Information

The filter hook is applied in the default check_admin_referrer() function after the nonce has been checked for security purposes; this allows a plugin to force WordPress to die for extra security reasons. Note that check_admin_referrer is also a “pluggable” function, meaning that plugins can override it.


Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
1.5.1Introduced.

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