Service
in package
Uses
UtilsProvider
Create an example REST Service.
Table of Contents
Methods
- getPluginConstantPrefix() : string
- Get the prefix of this package so we can utils package natively.
- instance() : mixed
- New instance.
- permission_callback() : mixed
- Check if user is allowed to call this service requests.
- rest_api_init() : mixed
- Register endpoints.
- routeCrossDismiss() : mixed
- See API docs.
- routeFeedbackCreate() : mixed
- See API docs.
- routeNewsletterSubscribe() : mixed
- See API docs.
- routeRatingDismiss() : mixed
- See API docs.
- setupConstants() : mixed
- Make sure the REAL_UTILS constants are available.
- sendDeactivationFeedbackEmail() : mixed
- Send a deactivation feedback via email. Internally it uses the support form API.
- __construct() : mixed
- C'tor.
Methods
getPluginConstantPrefix()
Get the prefix of this package so we can utils package natively.
public
getPluginConstantPrefix() : string
Return values
stringinstance()
New instance.
public
static instance() : mixed
Tags
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
routeCrossDismiss()
See API docs.
public
routeCrossDismiss(WP_REST_Request $request) : mixed
APIYes
Parameters
- $request : WP_REST_Request
Tags
routeFeedbackCreate()
See API docs.
public
routeFeedbackCreate(WP_REST_Request $request) : mixed
APIYes
Parameters
- $request : WP_REST_Request
Tags
routeNewsletterSubscribe()
See API docs.
public
routeNewsletterSubscribe(WP_REST_Request $request) : mixed
APIYes
Parameters
- $request : WP_REST_Request
Tags
routeRatingDismiss()
See API docs.
public
routeRatingDismiss(WP_REST_Request $request) : mixed
APIYes
Parameters
- $request : WP_REST_Request
Tags
setupConstants()
Make sure the REAL_UTILS constants are available.
public
static setupConstants() : mixed
sendDeactivationFeedbackEmail()
Send a deactivation feedback via email. Internally it uses the support form API.
protected
sendDeactivationFeedbackEmail(string $apiHost, string $slug, string $email, string $reason, string $note) : mixed
There are no validations done for e. g. passed email.
Parameters
- $apiHost : string
- $slug : string
- $email : string
- $reason : string
- $note : string
Tags
__construct()
C'tor.
private
__construct() : mixed