MySLP_REST_API
in package
Class MySLP_REST_API
Table of Contents
Properties
- $myslp : MySLP
- $myslp_namespace : string
- $options : string|null
- $slplus : SLPlus
- $status : array<string, bool>
- $user : int|null
Methods
- __construct() : mixed
- Default things to do/load when running this plugin
- add_hooks() : void
- Adding hooks
- delete_location() : WP_Error|array<string|int, mixed>
- Delete location
- edit_location() : mixed
- Edit location
- get_customer_history() : WP_REST_Response|WP_Error
- Return customer profile history rows for the given blog_id.
- get_invoices() : array<string|int, mixed>|WP_Error
- Retrieve a list of invoices.
- get_locations() : WP_Error|StdClass
- Get all locations
- get_locations_limit() : WP_Error|WP_REST_Response
- Callback for locations-limit route
- get_map_options() : StdClass
- Get options if api key is active
- get_user_account_info() : array<string|int, mixed>
- Get user account info
- getInvoices() : array<string|int, mixed>
- Retrieve invoices for the current user based on their payment processor and customer/subscription ID.
- register_routes() : void
- Register the necessary routes in here
- search_map() : WP_Error|StdClass
- Search map locations if api key is active
- attach_core_scripts() : string
- Return the MySLP and Core JavaScript as a string.
- catch_addon_scripts() : array<string|int, mixed>
- Get add on scripts.
- catch_addon_styles() : array<string|int, mixed>
- check_activation() : bool
- Check if the api key is active
- get_inline_style() : string
- get_layout_data() : false|string
- Get the DIV HTML for SLPLUS
- get_map_locations() : array<string|int, mixed>
- Get map locations, with its map positions
- get_options() : StdClass
- Get options
- get_options_data() : false|string
- Set the option data in the SLP scripts.
- myslp_get_dep_scripts() : array<string|int, mixed>
- Get dependent scripts.
- set_options() : void
- Set db prefix according to the user, who got api key provided in the request
Properties
$myslp
private
MySLP
$myslp
$myslp_namespace
private
string
$myslp_namespace
$options
private
string|null
$options
= \null
$slplus
private
SLPlus
$slplus
$status
private
array<string, bool>
$status
= []
$user
private
int|null
$user
= \null
Methods
__construct()
Default things to do/load when running this plugin
public
__construct() : mixed
add_hooks()
Adding hooks
public
add_hooks() : void
delete_location()
Delete location
public
delete_location(mixed $data) : WP_Error|array<string|int, mixed>
Parameters
- $data : mixed
Return values
WP_Error|array<string|int, mixed>edit_location()
Edit location
public
edit_location(mixed $data) : mixed
Parameters
- $data : mixed
get_customer_history()
Return customer profile history rows for the given blog_id.
public
get_customer_history(WP_REST_Request $request) : WP_REST_Response|WP_Error
Parameters
- $request : WP_REST_Request
Return values
WP_REST_Response|WP_Errorget_invoices()
Retrieve a list of invoices.
public
get_invoices() : array<string|int, mixed>|WP_Error
Return values
array<string|int, mixed>|WP_Error —A list of invoices or a WP_Error instance if fetching fails.
get_locations()
Get all locations
public
get_locations(WP_REST_Request $request) : WP_Error|StdClass
Parameters
- $request : WP_REST_Request
Return values
WP_Error|StdClassget_locations_limit()
Callback for locations-limit route
public
get_locations_limit() : WP_Error|WP_REST_Response
Tags
Return values
WP_Error|WP_REST_Response —location with its limit
get_map_options()
Get options if api key is active
public
get_map_options(WP_REST_Request $request) : StdClass
Parameters
- $request : WP_REST_Request
Return values
StdClassget_user_account_info()
Get user account info
public
get_user_account_info() : array<string|int, mixed>
Return values
array<string|int, mixed>getInvoices()
Retrieve invoices for the current user based on their payment processor and customer/subscription ID.
public
getInvoices() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —An array of invoices associated with the user.
register_routes()
Register the necessary routes in here
public
register_routes() : void
search_map()
Search map locations if api key is active
public
search_map(WP_REST_Request $request) : WP_Error|StdClass
Parameters
- $request : WP_REST_Request
Return values
WP_Error|StdClassattach_core_scripts()
Return the MySLP and Core JavaScript as a string.
private
attach_core_scripts() : string
Return values
stringcatch_addon_scripts()
Get add on scripts.
private
catch_addon_scripts() : array<string|int, mixed>
Return values
array<string|int, mixed>catch_addon_styles()
private
catch_addon_styles() : array<string|int, mixed>
Return values
array<string|int, mixed>check_activation()
Check if the api key is active
private
check_activation(string $API_key) : bool
Parameters
- $API_key : string
-
The api key
Return values
bool —True if the api key is active, else false
get_inline_style()
private
get_inline_style() : string
Return values
stringget_layout_data()
Get the DIV HTML for SLPLUS
private
get_layout_data(array<string|int, mixed> $attributes) : false|string
Parameters
- $attributes : array<string|int, mixed>
Return values
false|stringget_map_locations()
Get map locations, with its map positions
private
get_map_locations(array<string|int, mixed> $query) : array<string|int, mixed>
Parameters
- $query : array<string|int, mixed>
-
The executable query params | null to get from default options
Return values
array<string|int, mixed> —Locations
get_options()
Get options
private
get_options(array<string|int, mixed> $attributes) : StdClass
Parameters
- $attributes : array<string|int, mixed>
Tags
Return values
StdClass —The all map options.
get_options_data()
Set the option data in the SLP scripts.
private
get_options_data() : false|string
Return values
false|stringmyslp_get_dep_scripts()
Get dependent scripts.
private
myslp_get_dep_scripts(mixed $deps[, array<string|int, mixed> $return = array() ]) : array<string|int, mixed>
Parameters
- $deps : mixed
- $return : array<string|int, mixed> = array()
Return values
array<string|int, mixed>set_options()
Set db prefix according to the user, who got api key provided in the request
private
set_options() : void