MySLP_REST_API
in package
Class MySLP_REST_API
Table of Contents
Properties
- $myslp_namespace : mixed
- $option_modifier : mixed
- $options : mixed
- $slplus : mixed
- $status : mixed
- $user : mixed
Methods
- __construct() : mixed
- Default things to do/load when running this plugin
- add_hooks() : mixed
- Adding hooks
- add_location() : mixed
- Add location
- delete_location() : mixed
- Delete location
- edit_location() : mixed
- Edit location
- get_locations() : mixed
- Get all locations
- get_locations_limit() : WP_Error|WP_REST_ResponseAdd
- Callback for locations-limit route
- get_map_options() : mixed
- Get options, if api key is active
- get_user_account_info() : mixed
- Get user account info
- register_routes() : mixed
- Register necessary routes in here
- search_map() : mixed
- 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 it map positions
- get_options() : StdClass
- Get options
- get_options_data() : mixed|string|void
- Set the options data in the SLP scripts.
- get_search_locations() : mixed
- myslp_get_dep_scrips() : array<string|int, mixed>
- Get dependent scripts.
- set_options() : void
- Set db prefix according to the user, who got api key, provided in request
Properties
$myslp_namespace
private
mixed
$myslp_namespace
$option_modifier
private
mixed
$option_modifier
$options
private
mixed
$options
$slplus
private
mixed
$slplus
$status
private
mixed
$status
$user
private
mixed
$user
Methods
__construct()
Default things to do/load when running this plugin
public
__construct() : mixed
add_hooks()
Adding hooks
public
add_hooks() : mixed
add_location()
Add location
public
add_location(mixed $request) : mixed
Parameters
- $request : mixed
delete_location()
Delete location
public
delete_location(mixed $data) : mixed
Parameters
- $data : mixed
Tags
edit_location()
Edit location
public
edit_location(mixed $data) : mixed
Parameters
- $data : mixed
Tags
get_locations()
Get all locations
public
get_locations(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
get_locations_limit()
Callback for locations-limit route
public
get_locations_limit(WP_REST_Request $request) : WP_Error|WP_REST_ResponseAdd
Parameters
- $request : WP_REST_Request
Tags
Return values
WP_Error|WP_REST_ResponseAdd —location with it limit
get_map_options()
Get options, if api key is active
public
get_map_options(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
get_user_account_info()
Get user account info
public
get_user_account_info() : mixed
register_routes()
Register necessary routes in here
public
register_routes() : mixed
search_map()
Search map locations if api key is active
public
search_map(WP_REST_Request $request) : mixed
Parameters
- $request : WP_REST_Request
attach_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 it map positions
private
get_map_locations(string $type[, array<string|int, mixed> $query = null ][, int $limit = null ]) : array<string|int, mixed>
Parameters
- $type : string
-
load|search
- $query : array<string|int, mixed> = null
-
The executable query params | null to get from default options
- $limit : int = null
-
The limit of the locations to get | null to get initial_results_returned
Tags
Return values
array<string|int, mixed> —Locations
get_options()
Get options
private
get_options(mixed $attributes) : StdClass
Parameters
- $attributes : mixed
Tags
Return values
StdClass —The all map options.
get_options_data()
Set the options data in the SLP scripts.
private
get_options_data() : mixed|string|void
Return values
mixed|string|voidget_search_locations()
private
get_search_locations(mixed $query) : mixed
Parameters
- $query : mixed
myslp_get_dep_scrips()
Get dependent scripts.
private
myslp_get_dep_scrips( $deps[, array<string|int, mixed> $return = array() ]) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed>set_options()
Set db prefix according to the user, who got api key, provided in request
private
set_options() : void