GeneralSettingsSection
extends SettingsSection
in package
Class defining general plugin settings.
Tags
Table of Contents
- $options_group_slug : string
- Setting options group slug.
- $section_slug : string
- Settings section slug.
- $settings : Settings
- The plugin settings object.
- $settings_groups : array<string|int, mixed>
- The groups of settings within this section.
- $title : string
- Settings section title.
- __construct() : mixed
- Constructs the settings section.
- add_settings_fields() : void
- add_settings_section() : void
- get_options() : array<string|int, mixed>
- Creates an options group from the values of the settings in this section.
- get_options_group_slug() : string
- get_section_slug() : string
- Gets the settings section slug.
- get_setting() : Setting|null
- Retrieve a setting by its key.
- get_setting_value() : mixed
- Retrieve a setting's default value by its key.
- get_settings_group() : SettingsGroup|null
- Gets a settings groups from this section by its ID.
- get_title() : string
- Gets the settings section title.
- load_options_group() : void
- set_setting_value() : bool|null
- Set a setting's value by its key.
- setting_section_callback() : void
- add_settings_groups() : void
- Add the settings groups for this settings section.
- load_dependencies() : void
- Load the required dependencies.
Properties
$options_group_slug
Setting options group slug.
protected
string
$options_group_slug
Tags
$section_slug
Settings section slug.
protected
string
$section_slug
= ''
Tags
$settings
The plugin settings object.
protected
Settings
$settings
Tags
$settings_groups
The groups of settings within this section.
protected
array<string|int, mixed>
$settings_groups
Tags
$title
Settings section title.
protected
string
$title
= ''
Tags
Methods
__construct()
Constructs the settings section.
public
__construct(string $options_group_slug, string $section_slug, string $title, Settings $settings) : mixed
Parameters
- $options_group_slug : string
-
The slug of the settings section's options group.
- $section_slug : string
-
The slug of the settings section.
- $title : string
-
The name of the settings section.
- $settings : Settings
Tags
Return values
mixed —add_settings_fields()
public
add_settings_fields(mixed $component) : void
Parameters
- $component : mixed
Return values
void —add_settings_section()
public
add_settings_section() : void
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> —The options group.
get_options_group_slug()
public
get_options_group_slug() : string
Return values
string —get_section_slug()
Gets the settings section slug.
public
get_section_slug() : string
Tags
Return values
string —The section slug.
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()
Retrieve a setting's default value by its key.
public
get_setting_value(string $setting_key) : mixed
Parameters
- $setting_key : string
Tags
Return values
mixed —get_settings_group()
Gets a settings groups from this section by its ID.
public
get_settings_group(string $group_id) : SettingsGroup|null
Parameters
- $group_id : string
-
The ID of the settings group.
Tags
Return values
SettingsGroup|null —The section group. 'None' if none found.
get_title()
Gets the settings section title.
public
get_title() : string
Tags
Return values
string —The section title.
load_options_group()
public
load_options_group() : void
Return values
void —set_setting_value()
Set a setting's value by its key.
public
set_setting_value(string $setting_key, mixed $value) : bool|null
Parameters
- $setting_key : string
- $value : mixed
Tags
Return values
bool|null —setting_section_callback()
public
setting_section_callback() : void
Return values
void —add_settings_groups()
Add the settings groups for this settings section.
protected
add_settings_groups() : void
Tags
Return values
void —load_dependencies()
Load the required dependencies.
protected
load_dependencies() : void
Include the following files that provide the settings for this section:
- SettingsSection: defines a settings section;
- AMPCompatSettingsGroup;
- ReferenceContainerSettingsGroup;
- ScrollingSettingsGroup;
- ShortcodeSettingsGroup;
- NumberingSettingsGroup;
- HardLinksSettingsGroup;
- ExcerptsSettingsGroup; and
- LoveSettingsGroup.