API Routes
Less than 1 minute
Definition
class AAM_Framework_Service_ApiRoutes {
public deny(mixed $api_route) : bool
public allow(mixed $api_route) : bool
public reset(mixed $api_route = null) : bool
public is_denied(mixed $api_route) : bool
public is_allowed(mixed $api_route) : bool
}
The $api_route is used to define a single API route, specifying the endpoint URL and HTTP method. The $api_route can take one of three forms:
Instance of the
WP_REST_Requestclass. If identifier is an object of theWP_REST_Requestclass, theget_route()method retrieves the endpoint URL, and theget_method()method fetches the HTTP method.String combining HTTP method and endpoint. If identifier is a string containing a space, it is assumed to represent the HTTP method and endpoint (e.g.
'POST /aam/v2/jwt').Associative array with
endpointandmethodkeys. If identifier is an array, theendpointandmethodvalues are extracted using their respective keys.