Tkt_Template_Builder_Deactivator

Fired during plugin deactivation.

Description

This class defines all code necessary to run during the plugin's deactivation.

Tags
todo

This should probably be in one "Setup" Class together with Activator class.

since
0.0.1
author

Beda Schmid beda@tukutoi.com

Table of Contents

$action  : array<string|int, mixed>
The $_REQUEST['action'] during plugin activation.
$plugin  : string
The $_REQUEST['plugin'] during plugin activation.
$request  : array<string|int, mixed>
The $_REQUEST during plugin activation.
deactivate()  : mixed
Activate the plugin.
check_caps()  : bool
Check Capabilities.
get_request()  : bool|array<string|int, mixed>
Get the request.
validate_request()  : bool
Validate the Request data.

Properties

$action

The $_REQUEST['action'] during plugin activation.

private static array<string|int, mixed> $action = 'deactivate'
Description

The $_REQUEST[action] value during plugin activation.

Tags
since
0.0.1
access

private

$plugin

The $_REQUEST['plugin'] during plugin activation.

private static string $plugin = 'tkt-template-builder/tkt-template-builder.php'
Description

The $_REQUEST['plugin'] value during plugin activation.

Tags
since
0.0.1
access

private

$request

The $_REQUEST during plugin activation.

private static array<string|int, mixed> $request = array()
Description

The $_REQUEST array during plugin activation.

Tags
since
0.0.1
access

private

Methods

deactivate()

Activate the plugin.

public static deactivate() : mixed
Description

Checks if the plugin was (safely) activated. Place to add any custom action during plugin activation.

Tags
since
0.0.1
Return
(mixed)

check_caps()

Check Capabilities.

private static check_caps() : bool
Description

We want no one else but users with activate_plugins or above to be able to active this plugin.

Tags
since
0.0.1
Return
(bool) false if no caps, else true.

get_request()

Get the request.

private static get_request() : bool|array<string|int, mixed>
Description

Gets the $_REQUEST array and checks if necessary keys are set. Populates self::request with necessary and sanitized values.

Tags
since
0.0.1
Return
(bool |array<string|int, mixed>) false or self::$request array.

validate_request()

Validate the Request data.

private static validate_request(string $plugin) : bool
Description

Validates the $_REQUESTed data is matching this plugin and action.

Parameters
$plugin
(string) The Plugin folder/name.php.
Tags
since
0.0.1
Return
(bool) false if either plugin or action does not match, else true.

Search results