SLP_Power_Cron
extends SLPlus_BaseClass_Object
in package
The cron job processing class.
Table of Contents
Properties
- $addon : object
- $myslp : MySLP
- $slplus : SLPlus
- $uses_myslp : bool
- $uses_slplus : bool
- $slug : mixed
- $messages : SLP_Message_Manager
Methods
- __construct() : mixed
- __get() : SLPlus_BaseClass_Object
- __isset() : bool
- geocode_locations() : void
- Start the location geocoding.
- get_instance() : static
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- import_locations() : void
- Start the location import.
- import_remote_locations() : void
- Import Remote Locations
- make_bot_babies() : void
- Add our hooks that spin off bot babies.
- schedule_one_time_job() : mixed
- Schedule a one-time import.
- schedule_remote_file_retrieval() : array<string|int, mixed>
- Schedule a remote locations file retrieval.
- set_properties() : void
- Set our properties.
- initialize() : mixed
- Do these things when this object is invoked. Override in your class.
- connect_addon() : void
- Connnect the Power add on pointer and messages as needed.
- get_default_user_id_for_blog() : int
- Find the account user for a legacy cron event that has no user argument.
- run_in_tenant_context() : void
- Run a cron callback with the WordPress, MySLP, and SLP database context for its owner.
Properties
$addon
public
object
$addon
$myslp
public
MySLP
$myslp
$slplus
public
SLPlus
$slplus
$uses_myslp
public
bool
$uses_myslp
Set to true to add a $myslp property pointing to global $myslp
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$slug
protected
mixed
$slug
$messages
private
SLP_Message_Manager
$messages
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
public
__get(string $property) : SLPlus_BaseClass_Object
Parameters
- $property : string
Return values
SLPlus_BaseClass_Object__isset()
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
boolgeocode_locations()
Start the location geocoding.
public
geocode_locations(int $max_id[, int $user_id = 0 ][, int $blog_id = 0 ]) : void
Parameters
- $max_id : int
-
Maximum location ID.
- $user_id : int = 0
-
WordPress user that initiated the import.
- $blog_id : int = 0
-
WordPress blog that owns the import.
get_instance()
Return an instance of the object which is also registered to the slplus global less the SLP_ part.
public
static get_instance([bool $no_global = false ][, mixed $params = array() ]) : static
Parameters
- $no_global : bool = false
-
set to true to skip assigning object to SLP global as a property.
- $params : mixed = array()
-
object init params
Return values
staticimport_locations()
Start the location import.
public
import_locations(int $attachment_id[, int $user_id = 0 ][, int $blog_id = 0 ]) : void
Parameters
- $attachment_id : int
-
WordPress attachment ID.
- $user_id : int = 0
-
WordPress user that initiated the import.
- $blog_id : int = 0
-
WordPress blog that owns the import.
Tags
import_remote_locations()
Import Remote Locations
public
import_remote_locations(string $action, array<string|int, mixed> $params) : void
Parameters
- $action : string
-
'import_csv'
- $params : array<string|int, mixed>
-
the file_meta
Tags
make_bot_babies()
Add our hooks that spin off bot babies.
public
make_bot_babies() : void
Tags
schedule_one_time_job()
Schedule a one-time import.
public
schedule_one_time_job(array<string|int, mixed> $file_meta) : mixed
Parameters
- $file_meta : array<string|int, mixed>
schedule_remote_file_retrieval()
Schedule a remote locations file retrieval.
public
schedule_remote_file_retrieval() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>set_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : void
Parameters
- $options : array<string|int, mixed> = array()
initialize()
Do these things when this object is invoked. Override in your class.
protected
initialize() : mixed
connect_addon()
Connnect the Power add on pointer and messages as needed.
private
connect_addon() : void
get_default_user_id_for_blog()
Find the account user for a legacy cron event that has no user argument.
private
get_default_user_id_for_blog(int $blog_id) : int
Parameters
- $blog_id : int
-
WordPress blog ID.
Return values
int —WordPress user ID, or zero if the account cannot be resolved.
run_in_tenant_context()
Run a cron callback with the WordPress, MySLP, and SLP database context for its owner.
private
run_in_tenant_context(int $user_id, int $blog_id, callable $callback) : void
Parameters
- $user_id : int
-
WordPress user ID.
- $blog_id : int
-
WordPress blog ID.
- $callback : callable
-
Work to run after tenant context is established.