-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHTNonceValidatorInterface.class.php
25 lines (21 loc) · 1.11 KB
/
HTNonceValidatorInterface.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
/**
* This Interface has to be implemented for all custom HTNonce Validators.
* Static helper functions provided by HTNonce Class can be accessed to read/write context session values by context name.
*/
interface IHTNoncesValidator {
/**
* This callback will be invoked only once upon nonce creation, to give the validator a way to process its own internals and make preparations before a validate() invoke occurs.
*
* @param string $context_name The action context name for which session variables are accessible
* @return bool A false return will cancel the registration of the custom validator, so no validation invokes will occur.
*/
public function on_register ( $context_name );
/**
* This callback will be invoked after a WordPress Nonce is proven valid by the default validation implementation.
*
* @param string $context_name The action context name for which session variables are accessible
* @return bool A false return will prove the nonce as invalid, skipping any further custom validations for this action
*/
public function validate ( $context_name );
}