class Plugin extends Container implements Plugin

Traits

Properties

static protected Plugin $instance The current globally available container (if any).
string $slug The slug of this plugin.
protected string $file Buld in FILE relative plugin.
protected string $basePath The base path for the plugin installation.
protected string $baseUri The base uri for the plugin installation.
protected array $pluginData Internal use where store the plugin data.
protected array $provides A key value pairs array with the list of providers.

Methods

__get($name)

No description

__set(string $name, mixed $value)

Set the value of the method set{Name}Attribute.

__isset(string $name)

Extend the __isset method to check for the method get{Name}Attribute.

__unset(string $name)

Extend the __unset method to check for the method get{Name}Attribute.

bool
hasGetMutator(string $key)

Determine if a get mutator exists for an attribute.

mixed
mutateAttribute(string $key)

Get the value of an attribute using its mutator.

bool
hasSetMutator(string $key)

Determine if a set mutator exists for an attribute.

mixed
setMutatedAttributeValue(string $key, mixed $value)

Set the value of an attribute using its mutator.

__construct($basePath)

No description

boot()

No description

getOptionsAttribute()

No description

getRequestAttribute()

No description

getPluginBasenameAttribute()

No description

getCssAttribute()

No description

getJsAttribute()

No description

getImagesAttribute()

No description

set_screen_option($status, $option, $value)

No description

mixed
config(array|string $key = null, mixed $default = null)

Get / set the specified configuration value.

string
getBasePath()

Get the base path of the plugin installation.

string
getBaseUri()

Return the absolute URL for the installation plugin.

vendor($vendor = "wpbones")

No description

mixed
env(string $key, mixed $default = null)

Gets the value of an environment variable. Supports boolean, empty and null.

view(null $key = null, null $data = null)

Return an instance of View/Contract.

getPageUrl($pageSlug)

No description

provider($name)

No description

css(string|array $filename, array $deps = [], null $version = null)

Helper method to load (enqueue) styles.

js(string|array $filename, array $deps = [], null $version = null, bool $footer = true)

Helper method to load (enqueue) styles.

activation()

Called when a plugin is activate; register_activation_hook()

deactivation()

Called when a plugin is deactivate; register_deactivation_hook()

init()

Fires after WordPress has finished loading but before any headers are sent.

bool
isAjax()

Return TRUE if an Ajax called

log()

No description

admin_menu()

Fires before the administration menu loads in the admin.

widgets_init()

No description

getCallableHook($routes)

No description

Details

at line 193
__get($name)

Parameters

$name

in HasAttributes at line 32
__set(string $name, mixed $value)

Set the value of the method set{Name}Attribute.

Parameters

string $name Usually the protected property name.
mixed $value

in HasAttributes at line 45
__isset(string $name)

Extend the __isset method to check for the method get{Name}Attribute.

Parameters

string $name Usually the protected property name.

in HasAttributes at line 58
__unset(string $name)

Extend the __unset method to check for the method get{Name}Attribute.

Parameters

string $name Usually the protected property name.

in HasAttributes at line 72
bool hasGetMutator(string $key)

Determine if a get mutator exists for an attribute.

Parameters

string $key

Return Value

bool

in HasAttributes at line 83
protected mixed mutateAttribute(string $key)

Get the value of an attribute using its mutator.

Parameters

string $key

Return Value

mixed

in HasAttributes at line 94
bool hasSetMutator(string $key)

Determine if a set mutator exists for an attribute.

Parameters

string $key

Return Value

bool

in HasAttributes at line 106
protected mixed setMutatedAttributeValue(string $key, mixed $value)

Set the value of an attribute using its mutator.

Parameters

string $key
mixed $value

Return Value

mixed

at line 70
__construct($basePath)

Parameters

$basePath

at line 77
boot()

at line 155
protected getOptionsAttribute()

at line 164
protected getRequestAttribute()

at line 173
protected getPluginBasenameAttribute()

at line 178
protected getCssAttribute()

at line 183
protected getJsAttribute()

at line 188
protected getImagesAttribute()

at line 204
set_screen_option($status, $option, $value)

Parameters

$status
$option
$value

at line 223
mixed config(array|string $key = null, mixed $default = null)

Get / set the specified configuration value.

If an array is passed as the key, we will assume you want to set an array of values.

Parameters

array|string $key
mixed $default

Return Value

mixed

at line 258
string getBasePath()

Get the base path of the plugin installation.

Return Value

string

at line 268
string getBaseUri()

Return the absolute URL for the installation plugin.

Return Value

string

at line 273
vendor($vendor = "wpbones")

Parameters

$vendor

at line 286
mixed env(string $key, mixed $default = null)

Gets the value of an environment variable. Supports boolean, empty and null.

Parameters

string $key
mixed $default

Return Value

mixed

at line 299
View view(null $key = null, null $data = null)

Return an instance of View/Contract.

Parameters

null $key Optional. Default null.
null $data Optional. Default null.

Return Value

View

at line 306
getPageUrl($pageSlug)

Parameters

$pageSlug

at line 311
provider($name)

Parameters

$name

at line 329
css(string|array $filename, array $deps = [], null $version = null)

Helper method to load (enqueue) styles.

For your convenience, the params $filename may be an array of file.

Parameters

string|array $filename Filename
array $deps Optional. Dependences array
null $version Optional. Default plugin version

at line 353
js(string|array $filename, array $deps = [], null $version = null, bool $footer = true)

Helper method to load (enqueue) styles.

For your convenience, the params $filename may be an array of file.

Parameters

string|array $filename Filenames
array $deps Optional. Dependences array
null $version Optional. Default plugin version
bool $footer Optional. Load on footer. Default true

at line 372
activation()

Called when a plugin is activate; register_activation_hook()

at line 451
deactivation()

Called when a plugin is deactivate; register_deactivation_hook()

at line 466
init()

Fires after WordPress has finished loading but before any headers are sent.

Most of WP is loaded at this stage, and the user is authenticated. WP continues to load on the init hook that follows (e.g. widgets), and many plugins instantiate themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).

If you wish to plug an action once WP is loaded, use the wp_loaded hook below.

at line 518
bool isAjax()

Return TRUE if an Ajax called

Return Value

bool

at line 532
log()

at line 540
admin_menu()

Fires before the administration menu loads in the admin.

at line 549
widgets_init()

at line 563
getCallableHook($routes)

Parameters

$routes