Nonce
in package
Read onlyYes
FinalYes
Declares that a controller action (or every action of a controller) must carry a valid WordPress nonce for the given action string.
The WordPress counterpart of the Moodle adapter's #[Sesskey] attribute:
WpHttpKernel reads it (method wins over class) after the framework
#[Auth] attribute has been processed, resolves the nonce value from the
request ($param request field, then the X-WP-Nonce header) and rejects
the request with a 403 when verification fails.
Attributes
- #[Attribute]
- \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS
Table of Contents
Properties
Methods
- __construct() : mixed
Properties
$action
public
string
$action
$param
public
string
$param
= '_wpnonce'
$require
public
bool
$require
= true
Methods
__construct()
public
__construct(string $action[, string $param = '_wpnonce' ][, bool $require = true ]) : mixed
Parameters
- $action : string
- $param : string = '_wpnonce'
- $require : bool = true