Store Locator Plus®

SLP_AddOn extends SLPlus_BaseClass_Object
in package

Details about an Add On

Tags
propery-read

stdClass $cache a cached (transient) copy of some key properties

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?

$latest_version

public string $latest_version

get the latest version available from the update server.

$slug

public string $slug

the slug, shorthand such as slp-premier

$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

$latest_version

private mixed $latest_version

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
uses

_get_active, _get_cache, _get_latest_version, _get_name, _get_version, _get_was_active

__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
string

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() ]) : 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_Object

set_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
used-by

__get

Return values
bool|mixed

_get_cache()

Get cache.

private _get_cache() : mixed
Tags
used-by

__get

_get_latest_version()

Get the latest version from the update server.

private _get_latest_version() : string
Tags
used-by

__get

Return values
string

_get_name()

Get name.

private _get_name() : string
Tags
used-by

__get

Return values
string

_get_version()

Get version of an active instance. Also sets active property.

private _get_version() : string
Tags
used-by

__get

Return values
string

_get_was_active()

Get was_active.

private _get_was_active() : bool
Tags
used-by

__get

Return values
bool

cache_me_if_you_can()

Cache a copy of this add on less instance.

private cache_me_if_you_can() : mixed

        
On this page

Search results