WordPressHooksSettingsGroup
extends SettingsGroup
in package
Class defining the WordPress hook settings.
Tags
Table of Contents
- EXPERT_LOOKUP_THE_CONTENT = array('key' => 'footnote_inputfield_expert_lookup_the_content', 'name' => '<code>the_content()</code>', 'description' => '<a href="https://developer.wordpress.org/reference/hooks/the_content/" target="_blank">https://developer.wordpress.org/reference/hooks/the_content/</a>', 'default_value' => true, 'type' => 'boolean', 'input_type' => 'checkbox')
- Settings container key to enable the `the_content` hook.
- EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL = array('key' => 'footnote_inputfield_expert_lookup_the_content_priority_level', 'name' => '<code>the_content()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>. For <code>the_content</code>, this figure must be lower than 99 so that certain strings added by a plugin running at 99 may not be mistaken as a footnote. This makes also sure that the reference container displays above a feature inserted by a plugin running at 1200.', 'default_value' => 98, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
- Settings container key for `the_content` hook priority level.
- EXPERT_LOOKUP_THE_EXCERPT = array('key' => 'footnote_inputfield_expert_lookup_the_excerpt', 'name' => '<code>the_excerpt()</code>', 'description' => '<a href="https://developer.wordpress.org/reference/hooks/the_excerpt/" target="_blank">https://developer.wordpress.org/reference/hooks/the_excerpt/</a>', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
- Settings container key to enable the `the_excerpt` hook.
- EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL = array('key' => 'footnote_inputfield_expert_lookup_the_excerpt_priority_level', 'name' => '<code>the_excerpt()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => PHP_INT_MAX, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
- Settings container key for `the_excerpt` hook priority level.
- EXPERT_LOOKUP_THE_TITLE = array('key' => 'footnote_inputfield_expert_lookup_the_title', 'name' => '<code>the_title()</code>', 'description' => '<a href="https://developer.wordpress.org/reference/hooks/the_title/" target="_blank">https://developer.wordpress.org/reference/hooks/the_title/</a>', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
- Settings container key to enable the `the_title` hook.
- EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL = array('key' => 'footnote_inputfield_expert_lookup_the_title_priority_level', 'name' => '<code>the_title()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => PHP_INT_MAX, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
- Settings container key for `the_title` hook priority level.
- EXPERT_LOOKUP_WIDGET_TEXT = array('key' => 'footnote_inputfield_expert_lookup_widget_text', 'name' => '<code>widget_text()</code>', 'description' => '<a href="https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text" target="_blank">https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text</a>. The <code>widget_text()</code> hook must be enabled either when footnotes are present in theme text widgets, or when Elementor accordions or toggles shall have a reference container per section. If they should not, this hook must be disabled.', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
- Settings container key to enable the `widget_text` hook.
- EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL = array('key' => 'footnote_inputfield_expert_lookup_widget_text_priority_level', 'name' => '<code>widget_text()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => 98, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
- Settings container key for `widget_text` hook priority level.
- EXPERT_LOOKUP_WIDGET_TITLE = array('key' => 'footnote_inputfield_expert_lookup_widget_title', 'name' => '<code>widget_title()</code>', 'description' => '<a href="https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title" target="_blank">https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title</a>', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
- Settings container key to enable the `widget_title` hook.
- EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL = array('key' => 'footnote_inputfield_expert_lookup_widget_title_priority_level', 'name' => '<code>widget_title()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => PHP_INT_MAX, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
- Settings container key for `widget_title` hook priority level.
- GROUP_ID = 'wordpress-hooks'
- Setting group ID.
- GROUP_NAME = 'WordPress Hooks with Priority Level'
- Setting group name.
- $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
EXPERT_LOOKUP_THE_CONTENT
Settings container key to enable the `the_content` hook.
public
array<string|int, mixed>
EXPERT_LOOKUP_THE_CONTENT
= array('key' => 'footnote_inputfield_expert_lookup_the_content', 'name' => '<code>the_content()</code>', 'description' => '<a href="https://developer.wordpress.org/reference/hooks/the_content/" target="_blank">https://developer.wordpress.org/reference/hooks/the_content/</a>', 'default_value' => true, 'type' => 'boolean', 'input_type' => 'checkbox')
Tags
EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL
Settings container key for `the_content` hook priority level.
public
array<string|int, mixed>
EXPERT_LOOKUP_THE_CONTENT_PRIORITY_LEVEL
= array('key' => 'footnote_inputfield_expert_lookup_the_content_priority_level', 'name' => '<code>the_content()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>. For <code>the_content</code>, this figure must be lower than 99 so that certain strings added by a plugin running at 99 may not be mistaken as a footnote. This makes also sure that the reference container displays above a feature inserted by a plugin running at 1200.', 'default_value' => 98, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
Priority level of the_content
and of widget_text
as the only relevant
hooks must be less than 99 because social buttons may yield scripts
that contain the strings ‘((’ and ‘))’ (i.e., the default footnote
start and end shortcodes), which causes issues with fake footnotes.
Setting the_content
priority to 10 instead of PHP_INT_MAX
makes the
footnotes reference container display beneath the post and above other
features added by other plugins, e.g. related post lists and social buttons.
For the YARPP plugin to display related posts below the Footnotes reference container, priority needs to be at least 1,200.
PHP_INT_MAX
cannot be reset by leaving the number box empty, because
WebKit browsers don't allow it, so we must resort to -1.
Tags
EXPERT_LOOKUP_THE_EXCERPT
Settings container key to enable the `the_excerpt` hook.
public
array<string|int, mixed>
EXPERT_LOOKUP_THE_EXCERPT
= array('key' => 'footnote_inputfield_expert_lookup_the_excerpt', 'name' => '<code>the_excerpt()</code>', 'description' => '<a href="https://developer.wordpress.org/reference/hooks/the_excerpt/" target="_blank">https://developer.wordpress.org/reference/hooks/the_excerpt/</a>', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
Tags
EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL
Settings container key for `the_excerpt` hook priority level.
public
array<string|int, mixed>
EXPERT_LOOKUP_THE_EXCERPT_PRIORITY_LEVEL
= array('key' => 'footnote_inputfield_expert_lookup_the_excerpt_priority_level', 'name' => '<code>the_excerpt()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => PHP_INT_MAX, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
Tags
EXPERT_LOOKUP_THE_TITLE
Settings container key to enable the `the_title` hook.
public
array<string|int, mixed>
EXPERT_LOOKUP_THE_TITLE
= array('key' => 'footnote_inputfield_expert_lookup_the_title', 'name' => '<code>the_title()</code>', 'description' => '<a href="https://developer.wordpress.org/reference/hooks/the_title/" target="_blank">https://developer.wordpress.org/reference/hooks/the_title/</a>', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
These are checkboxes; the keyword checked
is converted to true
, whilst
an empty string (the default) is converted to false
.
Hooks should all be enabled by default to prevent users from thinking at first that the feature is broken in post titles (see here for more information).
Tags
EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL
Settings container key for `the_title` hook priority level.
public
array<string|int, mixed>
EXPERT_LOOKUP_THE_TITLE_PRIORITY_LEVEL
= array('key' => 'footnote_inputfield_expert_lookup_the_title_priority_level', 'name' => '<code>the_title()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => PHP_INT_MAX, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
Tags
EXPERT_LOOKUP_WIDGET_TEXT
Settings container key to enable the `widget_text` hook.
public
array<string|int, mixed>
EXPERT_LOOKUP_WIDGET_TEXT
= array('key' => 'footnote_inputfield_expert_lookup_widget_text', 'name' => '<code>widget_text()</code>', 'description' => '<a href="https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text" target="_blank">https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_text</a>. The <code>widget_text()</code> hook must be enabled either when footnotes are present in theme text widgets, or when Elementor accordions or toggles shall have a reference container per section. If they should not, this hook must be disabled.', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
The widget_text
hook must be disabled by default, because it causes
multiple reference containers to appear in Elementor accordions, but
it must be enabled if multiple reference containers are desired, as
in Elementor toggles.
Tags
EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL
Settings container key for `widget_text` hook priority level.
public
array<string|int, mixed>
EXPERT_LOOKUP_WIDGET_TEXT_PRIORITY_LEVEL
= array('key' => 'footnote_inputfield_expert_lookup_widget_text_priority_level', 'name' => '<code>widget_text()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => 98, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
Tags
EXPERT_LOOKUP_WIDGET_TITLE
Settings container key to enable the `widget_title` hook.
public
array<string|int, mixed>
EXPERT_LOOKUP_WIDGET_TITLE
= array('key' => 'footnote_inputfield_expert_lookup_widget_title', 'name' => '<code>widget_title()</code>', 'description' => '<a href="https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title" target="_blank">https://codex.wordpress.org/Plugin_API/Filter_Reference/widget_title</a>', 'default_value' => false, 'type' => 'boolean', 'input_type' => 'checkbox')
Tags
EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL
Settings container key for `widget_title` hook priority level.
public
array<string|int, mixed>
EXPERT_LOOKUP_WIDGET_TITLE_PRIORITY_LEVEL
= array('key' => 'footnote_inputfield_expert_lookup_widget_title_priority_level', 'name' => '<code>widget_title()</code> Priority Level', 'description' => 'The priority level determines whether Footnotes is executed timely before other plugins, and how the reference container is positioned relative to other features. 9223372036854775807 is lowest priority, 0 is highest. To set priority level to lowest, set it to -1, interpreted as 9223372036854775807, the constant <code>PHP_INT_MAX</code>.', 'default_value' => PHP_INT_MAX, 'type' => 'number', 'input_type' => 'number', 'input_max' => PHP_INT_MAX, 'input_min' => -1)
Tags
GROUP_ID
Setting group ID.
public
string
GROUP_ID
= 'wordpress-hooks'
Tags
GROUP_NAME
Setting group name.
public
string
GROUP_NAME
= 'WordPress Hooks with Priority Level'
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.