WPDev.one
Core Function
View Source on Trac ↗

check_admin_referer()

check_admin_referer( mixed $action = -1, mixed $query_arg = '_wpnonce' )

Ensures intent by verifying that a user was referred from another admin page with the correct security nonce.

Parameters 1 required

Name / Type Description
(int

| string) $action The nonce action.

Required
$query_arg
string

Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'.

Return Value

((int)
(int | false) 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. False if the nonce is invalid.

Function Information

Since Version
1.2.0
Source File
wp-includes/pluggable.php
Advertisement