Plugin extends Premium_Plugin implements Licensed_Plugin, Registerable, Translatable, Service_Provider

The main plugin class. Sets up the plugin services and loads them when WordPress runs.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

Interfaces, Classes and Traits

Licensed_Plugin
Extends the Plugin interface to add additional functions for licensed plugins.
Registerable
An object that can be registered with WordPress via the Plugin API, i.e. add_action() and add_filter().
Translatable
Something that can be translated by WordPress.
Service_Provider
An object that provides services (instances of Barn2\WLT_Lib\Service).

Table of Contents

ITEM_ID  = 128235
NAME  = 'WooCommerce Lead Time'
$data  : mixed
$file  : mixed
$basename  : mixed
$dir_path  : mixed
$dir_url  : mixed
$services  : array<string|int, Service>
__construct()  : mixed
Creates a new Plugin object.
get_basename()  : string
Get the 'basename' for the plugin (e.g. my-plugin/my-plugin.php).
get_dir_path()  : string
Get the full directory path to the plugin folder, with trailing slash (e.g. /wp-content/plugins/my-plugin/).
get_dir_url()  : string
Get the URL to the plugin folder.
get_documentation_url()  : string
Get the documentation URL for this plugin.
get_file()  : string
Get the full path to the main plugin file.
get_id()  : mixed
Get the plugin ID, usually the EDD Download ID.
get_instance()  : Plugin
Return an instance of this class.
get_item_id()  : int
Get the item ID for the plugin, usually the EDD Download ID.
get_legacy_db_prefix()  : string
Get the legacy database prefix for the old license system.
get_license()  : License
Get the plugin license object.
get_license_page_url()  : string
Get the URL of the page where license settings are managed.
get_license_setting()  : License_Setting
Get the license setting for the plugin.
get_name()  : string
Get the name of this plugin.
get_plugin_slug()  : string
Return the plugin slug.
get_service()  : null|Service
Gets the plugin service by ID.
get_services()  : array<string|int, Service>
Gets all the plugin services.
get_settings_page_url()  : string
Get the settings page URL in the WordPress admin.
get_slug()  : string
Get the slug for this plugin (e.g. my-plugin).
get_support_url()  : string
Get the support URL for this plugin.
get_version()  : string
Get the plugin version number (e.g. 1.3.2).
has_valid_license()  : bool
Does this plugin have a valid license?
is_edd()  : bool
Is this plugin an Easy Digital Downloads extension?
is_woocommerce()  : bool
Is this plugin a WooCommerce extension?
load_services()  : mixed
Initialise service classes.
load_textdomain()  : void
Load the plugin language file for i18n
register()  : void
Register this object with WordPress.

Constants

ITEM_ID

public mixed ITEM_ID = 128235

NAME

public mixed NAME = 'WooCommerce Lead Time'

Properties

$services

private array<string|int, Service> $services = []

The list of plugin services.

Methods

__construct()

Creates a new Plugin object.

public __construct(mixed $file[, mixed $version = '1.0' ]) : mixed
Parameters
$file : mixed
$version : mixed = '1.0'
Return values
mixed

get_basename()

Get the 'basename' for the plugin (e.g. my-plugin/my-plugin.php).

public get_basename() : string
Return values
string

The plugin basename.

get_dir_path()

Get the full directory path to the plugin folder, with trailing slash (e.g. /wp-content/plugins/my-plugin/).

public get_dir_path() : string
Return values
string

The plugin directory path.

get_dir_url()

Get the URL to the plugin folder.

public get_dir_url() : string
Return values
string

(URL)

get_documentation_url()

Get the documentation URL for this plugin.

public get_documentation_url() : string
Return values
string

(URL)

get_file()

Get the full path to the main plugin file.

public get_file() : string
Return values
string

The plugin file.

get_id()

Get the plugin ID, usually the EDD Download ID.

public get_id() : mixed

$return int The plugin ID.

Return values
mixed

get_instance()

Return an instance of this class.

public static get_instance() : Plugin
Tags
deprecated
1.2
Return values
Plugin

A single instance of this class.

get_item_id()

Get the item ID for the plugin, usually the EDD Download ID.

public get_item_id() : int
Tags
deprecated

since 1.2 Replaced by Simple_Plugin::get_id()

Return values
int

The item ID

get_legacy_db_prefix()

Get the legacy database prefix for the old license system.

public get_legacy_db_prefix() : string
Return values
string

The prefix or an empty string if not applicable

get_license()

Get the plugin license object.

public get_license() : License
Return values
License

get_license_page_url()

Get the URL of the page where license settings are managed.

public get_license_page_url() : string
Return values
string

The license setting URL

get_license_setting()

Get the license setting for the plugin.

public get_license_setting() : License_Setting
Return values
License_Setting

get_name()

Get the name of this plugin.

public get_name() : string
Return values
string

The plugin name.

get_plugin_slug()

Return the plugin slug.

public get_plugin_slug() : string
Tags
deprecated
1.2
Return values
string

The plugin slug.

get_service()

Gets the plugin service by ID.

public get_service(string $id) : null|Service
Parameters
$id : string

The service ID.

Return values
null|Service

The service object or null if not found.

get_services()

Gets all the plugin services.

public get_services() : array<string|int, Service>
Return values
array<string|int, Service>

The array of plugin services.

get_settings_page_url()

Get the settings page URL in the WordPress admin.

public get_settings_page_url() : string
Return values
string

(URL)

get_slug()

Get the slug for this plugin (e.g. my-plugin).

public get_slug() : string
Return values
string

The plugin slug.

get_support_url()

Get the support URL for this plugin.

public get_support_url() : string
Return values
string

(URL)

get_version()

Get the plugin version number (e.g. 1.3.2).

public get_version() : string
Return values
string

The version number.

has_valid_license()

Does this plugin have a valid license?

public has_valid_license() : bool
Return values
bool

true if valid.

is_edd()

Is this plugin an Easy Digital Downloads extension?

public is_edd() : bool
Return values
bool

true if it's an EDD extension.

is_woocommerce()

Is this plugin a WooCommerce extension?

public is_woocommerce() : bool
Return values
bool

true if it's a WooCommerce extension.

load_services()

Initialise service classes.

public load_services() : mixed
Return values
mixed

load_textdomain()

Load the plugin language file for i18n

public load_textdomain() : void
Return values
void

register()

Register this object with WordPress.

public register() : void
Return values
void

Search results