LoveSettingsGroup
extends SettingsGroup
in package
Class defining the footnote love settings.
Tags
Table of Contents
- FOOTNOTES_LOVE = array('key' => 'footnote_inputfield_love', 'name' => 'Tell the world you're using the plugin!', 'default_value' => 'no', 'type' => 'string', 'input_type' => 'select', 'input_options' => array( // Logo only. 'text-3' => self::PLUGIN_SYMBOL, // Logo followed by heart symbol. 'text-4' => self::PLUGIN_SYMBOL . ' ' . self::LOVE_SYMBOL, // Logo preceded by heart symbol. 'text-5' => self::LOVE_SYMBOL . ' ' . self::PLUGIN_SYMBOL, // Translators: 2: heart symbol 1: footnotes logogram. 'text-1' => 'I ' . self::LOVE_SYMBOL . ' ' . self::PLUGIN_SYMBOL, // Translators: %s: Footnotes plugin logo. 'text-6' => 'This website uses ' . self::PLUGIN_SYMBOL, // Translators: %s: Footnotes plugin logo. 'text-7' => 'This website uses the ' . self::PLUGIN_SYMBOL . ' plugin', // Translators: %s: Footnotes plugin logo. 'text-2' => 'This website uses the awesome ' . self::PLUGIN_SYMBOL . ' plugin', 'random' => 'randomly determined display of either mention', // Translators: 1: Plugin logo.2: heart symbol. 'no' => 'no display of any mention in the footer', ))
- Settings container key for the ‘I love footnotes’ text.
- FOOTNOTES_NO_LOVE_SLUG = array('key' => 'footnote_inputfield_no_love_slug', 'name' => 'Shortcode to inhibit the display of the ' . self::PLUGIN_SYMBOL . ' mention on specific pages', 'default_value' => '[[no footnotes: love]]', 'type' => 'string', 'input_type' => 'text')
- Settings container key for the shortcode to NOT display the ‘LOVE ME’ slug on certain pages.
- GROUP_ID = 'love'
- Setting group ID.
- GROUP_NAME = self::PLUGIN_SYMBOL . ' ' . self::LOVE_SYMBOL
- Setting group name.
- LOVE_SYMBOL = '<span style="color:#ff6d3b; font-weight:bold;">♥</span>'
- The HTML 'love' symbol.
- PLUGIN_SYMBOL = '<span class="footnotes_logo footnotes_logo_part1">foot</span><span class="footnotes_logo footnotes_logo_part2">notes</span>'
- The HTML Plugin logogram.
- $options_group_slug : string
- Setting options group slug.
- $section_slug : string
- Setting section slug.
- $setting_classes : array<string|int, mixed>
- The setting classes.
- $settings : array<string|int, mixed>
- The settings in this group.
- $settings_obj : Settings
- The plugin settings object.
- __construct() : mixed
- Constructs the settings section.
- add_settings_fields() : void
- Adds all the settings fields for this group to the admin. dashboard.
- get_options() : array<string|int, mixed>
- Creates an options group from the values of the settings in this section.
- get_setting() : Setting|null
- Retrieve a setting by its key.
- get_setting_value() : mixed
- Get a setting's value by its key.
- set_setting_value() : bool
- Set a setting's value by its key.
- add_setting() : Setting
- Constructs settings from the provided details.
- add_settings() : void
- Add the settings for this settings group.
- load_dependencies() : void
- Load the required dependencies.
- load_values() : void
- Load the values for this settings group.
Constants
FOOTNOTES_LOVE
Settings container key for the ‘I love footnotes’ text.
public
array<string|int, mixed>
FOOTNOTES_LOVE
= array('key' => 'footnote_inputfield_love', 'name' => 'Tell the world you're using the plugin!', 'default_value' => 'no', 'type' => 'string', 'input_type' => 'select', 'input_options' => array(
// Logo only.
'text-3' => self::PLUGIN_SYMBOL,
// Logo followed by heart symbol.
'text-4' => self::PLUGIN_SYMBOL . ' ' . self::LOVE_SYMBOL,
// Logo preceded by heart symbol.
'text-5' => self::LOVE_SYMBOL . ' ' . self::PLUGIN_SYMBOL,
// Translators: 2: heart symbol 1: footnotes logogram.
'text-1' => 'I ' . self::LOVE_SYMBOL . ' ' . self::PLUGIN_SYMBOL,
// Translators: %s: Footnotes plugin logo.
'text-6' => 'This website uses ' . self::PLUGIN_SYMBOL,
// Translators: %s: Footnotes plugin logo.
'text-7' => 'This website uses the ' . self::PLUGIN_SYMBOL . ' plugin',
// Translators: %s: Footnotes plugin logo.
'text-2' => 'This website uses the awesome ' . self::PLUGIN_SYMBOL . ' plugin',
'random' => 'randomly determined display of either mention',
// Translators: 1: Plugin logo.2: heart symbol.
'no' => 'no display of any mention in the footer',
))
Tags
FOOTNOTES_NO_LOVE_SLUG
Settings container key for the shortcode to NOT display the ‘LOVE ME’ slug on certain pages.
public
array<string|int, mixed>
FOOTNOTES_NO_LOVE_SLUG
= array('key' => 'footnote_inputfield_no_love_slug', 'name' => 'Shortcode to inhibit the display of the ' . self::PLUGIN_SYMBOL . ' mention on specific pages', 'default_value' => '[[no footnotes: love]]', 'type' => 'string', 'input_type' => 'text')
Tags
GROUP_ID
Setting group ID.
public
string
GROUP_ID
= 'love'
Tags
GROUP_NAME
Setting group name.
public
string
GROUP_NAME
= self::PLUGIN_SYMBOL . ' ' . self::LOVE_SYMBOL
Tags
LOVE_SYMBOL
The HTML 'love' symbol.
public
string
LOVE_SYMBOL
= '<span style="color:#ff6d3b; font-weight:bold;">♥</span>'
Tags
PLUGIN_SYMBOL
The HTML Plugin logogram.
public
string
PLUGIN_SYMBOL
= '<span class="footnotes_logo footnotes_logo_part1">foot</span><span class="footnotes_logo footnotes_logo_part2">notes</span>'
Tags
Properties
$options_group_slug
Setting options group slug.
protected
string
$options_group_slug
Tags
$section_slug
Setting section slug.
protected
string
$section_slug
Tags
$setting_classes
The setting classes.
protected
array<string|int, mixed>
$setting_classes
Tags
$settings
The settings in this group.
protected
array<string|int, mixed>
$settings
Tags
$settings_obj
The plugin settings object.
protected
Settings
$settings_obj
Tags
Methods
__construct()
Constructs the settings section.
public
__construct(string $options_group_slug, string $section_slug, Settings $settings_obj) : mixed
Parameters
- $options_group_slug : string
- $section_slug : string
- $settings_obj : Settings
Tags
Return values
mixed —add_settings_fields()
Adds all the settings fields for this group to the admin. dashboard.
public
add_settings_fields(SettingsPage $component) : void
Parameters
- $component : SettingsPage
-
The admin. dashboard settings page.
Tags
Return values
void —get_options()
Creates an options group from the values of the settings in this section.
public
get_options() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —get_setting()
Retrieve a setting by its key.
public
get_setting(string $setting_key) : Setting|null
Parameters
- $setting_key : string
Tags
Return values
Setting|null —get_setting_value()
Get a setting's value by its key.
public
get_setting_value(string $setting_key) : mixed
Parameters
- $setting_key : string
Tags
Return values
mixed —set_setting_value()
Set a setting's value by its key.
public
set_setting_value(string $setting_key, mixed $value) : bool
Parameters
- $setting_key : string
- $value : mixed
Tags
Return values
bool —add_setting()
Constructs settings from the provided details.
protected
add_setting(array<string, mixed> $setting) : Setting
Parameters
- $setting : array<string, mixed>
-
The setting details.
Tags
Return values
Setting —The constructed setting object.
add_settings()
Add the settings for this settings group.
protected
add_settings(array<string|int, mixed>|false $options) : void
Parameters
- $options : array<string|int, mixed>|false
-
Saved values for the settings in this group. 'False' if none exist.
Tags
Return values
void —load_dependencies()
Load the required dependencies.
protected
load_dependencies() : void
Include the following files that provide the settings for this plugin:
- Setting: defines individual settings.
Tags
Return values
void —load_values()
Load the values for this settings group.
protected
load_values(array<string, mixed>|false $options) : void
Parameters
- $options : array<string, mixed>|false
-
Saved values for the settings in this group. 'False' if none exist.