Plugin_Setup implements Plugin_Activation_Listener, Registerable, Core_Service

Plugin Setup

Tags
author

Barn2 Plugins [email protected]

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Plugin_Activation_Listener
Registerable
Core_Service

Table of Contents

$plugin  : Licensed_Plugin
Instance of the plugin.
$slug  : string
Plugin slug.
__construct()  : mixed
Constructor.
maybe_redirect_after_activation()  : mixed
Redirect to the setup wizard after plugin activation.
on_activate()  : mixed
On plugin activation
on_deactivate()  : void
Handles actions to perform on plugin deactivation.
redirect()  : void
Redirect to the generator page with the `wizard` flag enabled.
register()  : mixed
{@inheritdoc}
create_search_results_page()  : mixed
Creates the search results page.
is_bulk_activation()  : bool
Determine whether the current request is a bulk activation.

Properties

$plugin

Instance of the plugin.

private Licensed_Plugin $plugin
Tags

Methods

__construct()

Constructor.

public __construct(Licensed_Plugin $plugin) : mixed
Parameters
$plugin : Licensed_Plugin

The plugin instance.

Tags
Return values
mixed

maybe_redirect_after_activation()

Redirect to the setup wizard after plugin activation.

public maybe_redirect_after_activation(string $plugin, bool $network_wide) : mixed
Parameters
$plugin : string

Path to the plugin file relative to the plugins directory.

$network_wide : bool

Whether the plugin is being activated network-wide.

Tags
Return values
mixed

on_activate()

On plugin activation

public on_activate(bool $network_wide) : mixed
Parameters
$network_wide : bool

Whether the plugin is being activated network-wide.

Tags
Return values
mixed

on_deactivate()

Handles actions to perform on plugin deactivation.

public on_deactivate(bool $network_wide) : void
Parameters
$network_wide : bool

Whether the plugin is being deactivated network-wide.

Tags
Return values
void

redirect()

Redirect to the generator page with the `wizard` flag enabled.

public redirect() : void
Tags
Return values
void

register()

{@inheritdoc}

public register() : mixed
Tags
Return values
mixed

create_search_results_page()

Creates the search results page.

private create_search_results_page() : mixed
Tags
Return values
mixed

is_bulk_activation()

Determine whether the current request is a bulk activation.

private is_bulk_activation() : bool
Tags
Return values
bool

Search results