Consent
in package
uses
UtilsProvider
Consent API
Table of Contents
Constants
- CONSENT_ALL_ITEMS_PER_PAGE : mixed = 10
Methods
- application_password_is_api_request() : mixed
- Public Real Cookie Banner REST endpoints must stay anonymous: no login and no Application Password auth. Application Passwords reuse HTTP Basic Auth, so directory protection (Plesk, Traefik) looks like a failed login (`invalid_username`) and Core would 401 these visitor routes.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- instance() : mixed
- New instance.
- permission_callback() : mixed
- Check if user is allowed to call this service requests.
- rest_api_init() : mixed
- Register endpoints.
- routeDelete() : mixed
- See API docs.
- routeDeleteAll() : mixed
- See API docs.
- routeDeleteClear() : mixed
- See API docs.
- routeGet() : mixed
- See API docs.
- routeGetAll() : mixed
- See API docs.
- routeGetAllReferer() : mixed
- See API docs.
- routePost() : mixed
- See API docs.
- routePostDynamicPredecision() : mixed
- See API docs.
- isAnonymousConsentRestRoute() : mixed
- Visitor-facing consent routes (`permission_callback` is `__return_true`).
- __construct() : mixed
- C'tor.
Constants
CONSENT_ALL_ITEMS_PER_PAGE
public
mixed
CONSENT_ALL_ITEMS_PER_PAGE
= 10
Methods
application_password_is_api_request()
Public Real Cookie Banner REST endpoints must stay anonymous: no login and no Application Password auth. Application Passwords reuse HTTP Basic Auth, so directory protection (Plesk, Traefik) looks like a failed login (`invalid_username`) and Core would 401 these visitor routes.
public
application_password_is_api_request(bool $isApiRequest) : mixed
That conflicts with the consent check loopback (SavingConsentViaRestApiEndpointChecker),
which must forward directory-protection Basic Auth so the dummy POST reaches /consent
behind Traefik/Plesk — without this filter the check reports a false-positive failure.
Parameters
- $isApiRequest : bool
Tags
getPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringinstance()
New instance.
public
static instance() : mixed
permission_callback()
Check if user is allowed to call this service requests.
public
permission_callback() : mixed
rest_api_init()
Register endpoints.
public
rest_api_init() : mixed
routeDelete()
See API docs.
public
routeDelete(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
Tags
routeDeleteAll()
See API docs.
public
routeDeleteAll() : mixed
Tags
routeDeleteClear()
See API docs.
public
routeDeleteClear(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
Tags
routeGet()
See API docs.
public
routeGet(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
Tags
routeGetAll()
See API docs.
public
routeGetAll(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
Tags
routeGetAllReferer()
See API docs.
public
routeGetAllReferer(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
Tags
routePost()
See API docs.
public
routePost(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
Tags
routePostDynamicPredecision()
See API docs.
public
routePostDynamicPredecision(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
Tags
isAnonymousConsentRestRoute()
Visitor-facing consent routes (`permission_callback` is `__return_true`).
protected
isAnonymousConsentRestRoute() : mixed
determine_current_user runs before rest_route is filled, so fall back to REQUEST_URI.
__construct()
C'tor.
private
__construct() : mixed