SLP_AddOn
extends SLPlus_BaseClass_Object
in package
Details about an Add On
Tags
Table of Contents
Constants
- TRANSIENT_BASE = 'slp_addon_'
Properties
- $active : bool
- $instance : SLP_BaseClass_Addon
- $instance : mixed
- $latest_version : string
- $name : string
- $slplus : SLPlus
- $slug : string
- $slug : mixed
- $uses_slplus : bool
- $version : string
- $was_active : bool
- $slplus : mixed
- $uses_slplus : mixed
- $active : mixed
- $cache : mixed
- $latest_version : mixed
- $name : mixed
- $version : mixed
- $was_active : mixed
Methods
- __construct() : mixed
- __get() : mixed
- Get a property.
- __isset() : bool
- Allow isset to be called on private properties.
- __toString() : string
- For sanitize_key filters that FUBAR the sanitize_key method in the constructor.
- get_instance() : SLPlus_BaseClass_Object
- Return an instance of the object which is also registered to the slplus global less the SLP_ part.
- set_properties() : mixed
- Set our properties.
- initialize() : mixed
- Do these things when this object is invoked. Override in your class.
- _get_active() : bool|mixed
- Get active.
- _get_cache() : mixed
- Get cache.
- _get_latest_version() : string
- Get the latest version from the update server.
- _get_name() : string
- Get name.
- _get_version() : string
- Get version of an active instance. Also sets active property.
- _get_was_active() : bool
- Get was_active.
- cache_me_if_you_can() : mixed
- Cache a copy of this add on less instance.
Constants
TRANSIENT_BASE
public
mixed
TRANSIENT_BASE
= 'slp_addon_'
Properties
$active read-only
public
bool
$active
is this add on active now?
$instance
public
SLP_BaseClass_Addon
$instance
the instantiated add on object
$instance
public
mixed
$instance
$latest_version
public
string
$latest_version
get the latest version available from the update server.
$name
public
string
$name
full text name
$slplus
public
SLPlus
$slplus
$slug
public
string
$slug
the slug, shorthand such as slp-premier
$slug
public
mixed
$slug
$uses_slplus
public
bool
$uses_slplus
Set to true (default) if the object needs access to the SLPlus plugin object.
$version read-only
public
string
$version
the version of an ACTIVE add on
$was_active read-only
public
bool
$was_active
true if this add on was ever active on this site
$slplus
protected
mixed
$slplus
$uses_slplus
protected
mixed
$uses_slplus
= \true
$active
private
mixed
$active
$cache
private
mixed
$cache
$latest_version
private
mixed
$latest_version
$name
private
mixed
$name
$version
private
mixed
$version
$was_active
private
mixed
$was_active
Methods
__construct()
public
__construct([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
__get()
Get a property.
public
__get(mixed $property) : mixed
Parameters
- $property : mixed
Tags
__isset()
Allow isset to be called on private properties.
public
__isset(string $property) : bool
Parameters
- $property : string
Return values
bool__toString()
For sanitize_key filters that FUBAR the sanitize_key method in the constructor.
public
__toString() : string
This should not be necessary, but some plugins and themes are broken.
Return values
stringget_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() ]) : SLPlus_BaseClass_Object
TODO: PHP7.4 and PHP8.0 the static instance variable returns an object matching $class TODO: PHP8.1 the static instance continually returns the FIRST object (SLP_Admin_Helper) every time -- it is like PHP8.1 static instance is bound to base_class-object versus the calling class object
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
SLPlus_BaseClass_Objectset_properties()
Set our properties.
public
set_properties([array<string|int, mixed> $options = array() ]) : mixed
Parameters
- $options : array<string|int, mixed> = array()
initialize()
Do these things when this object is invoked. Override in your class.
protected
initialize() : mixed
_get_active()
Get active.
private
_get_active() : bool|mixed
Tags
Return values
bool|mixed_get_cache()
Get cache.
private
_get_cache() : mixed
Tags
_get_latest_version()
Get the latest version from the update server.
private
_get_latest_version() : string
Tags
Return values
string_get_name()
Get name.
private
_get_name() : string
Tags
Return values
string_get_version()
Get version of an active instance. Also sets active property.
private
_get_version() : string
Tags
Return values
string_get_was_active()
Get was_active.
private
_get_was_active() : bool
Tags
Return values
boolcache_me_if_you_can()
Cache a copy of this add on less instance.
private
cache_me_if_you_can() : mixed