Plugin_Promo extends Abstract_Plugin_Promo implements Registerable

Provides functions to add the plugin promo to the relevant section of the WooCommerce settings page.

Tags
author

Barn2 Plugins support@barn2.com

license

GPL-3.0

copyright

Barn2 Media Ltd

version
1.3

Interfaces, Classes and Traits

Registerable
An object that can be registered with WordPress via the Plugin API, i.e. add_action() and add_filter().

Table of Contents

$plugin  : Plugin
$promo_content  : string
$section  : string
$tab  : string
__construct()  : mixed
Constructor.
add_plugin_promo_field()  : mixed
barn2_promo_end_field()  : mixed
barn2_promo_start_field()  : mixed
load_styles()  : void
Load the plugin promo stylesheet.
register()  : void
Register this object with WordPress.
get_promo_content()  : string
Retrieve the plugin promo content from the API.
get_promo_sidebar()  : string
Retrieve the complete promo sidebar to insert into the settings page.

Properties

$section

private string $section

The WooCommerce settings section to display the promo, e.g. inventory

$tab

private string $tab

The WooCommerce settings tab to display the promo, e.g. products

Methods

__construct()

Constructor.

public __construct(Plugin $plugin, string $settings_tab[, string $settings_section = '' ]) : mixed
Parameters
$plugin : Plugin

The plugin object

$settings_tab : string

The WooCommerce settings tab to display the promo, e.g. products

$settings_section : string = ''

The WooCommerce settings section to display the promo, e.g. inventory

Return values
mixed

add_plugin_promo_field()

public add_plugin_promo_field(mixed $settings, mixed $current_section) : mixed
Parameters
$settings : mixed
$current_section : mixed
Return values
mixed

barn2_promo_end_field()

public barn2_promo_end_field(mixed $field) : mixed
Parameters
$field : mixed
Return values
mixed

barn2_promo_start_field()

public barn2_promo_start_field(mixed $field) : mixed
Parameters
$field : mixed
Return values
mixed

load_styles()

Load the plugin promo stylesheet.

public load_styles() : void
Return values
void

register()

Register this object with WordPress.

public register() : void
Return values
void

get_promo_content()

Retrieve the plugin promo content from the API.

protected get_promo_content() : string
Return values
string

The promo sidebar content.

get_promo_sidebar()

Retrieve the complete promo sidebar to insert into the settings page.

protected get_promo_sidebar() : string
Return values
string

The promo sidebar.

Search results