This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
footnotes/src/includes/settings/custom-css/class-custom-css-settings-section.php
Rumperuu bdb7dee5ee refactor: redo remaining settings
Note: the already-deprecated `FOOTNOTES_EXPERT_MODE`, `CUSTOM_CSS` and
`CUSTOM_CSS_LEGACY_MODE_ENABLE` settings have been dropped. The original
`CUSTOM_CSS_NEW` setting has been renamed to `CUSTOM_CSS`.
2021-08-08 15:01:01 +01:00

63 lines
1.4 KiB
PHP

<?php
/**
* File providing the `CustomCSSSettingsSection` class.
*
* @package footnotes
* @since 2.8.0
*/
declare(strict_types=1);
namespace footnotes\includes\settings\customcss;
require_once plugin_dir_path( __DIR__ ) . 'class-settings-section.php';
use footnotes\includes\settings\SettingsSection;
// Import settings groups.
use footnotes\includes\settings\customcss\CustomCSSSettingsGroup;
/**
* Class defining plugin referrer and tooltips settings.
*
* @package footnotes
* @since 2.8.0
*/
class CustomCSSSettingsSection extends SettingsSection {
/**
* The groups of settings within this section.
*
* @var SettingsGroup[]
*
* @since 2.8.0
*/
protected array $settings_groups;
public function __construct(
$options_group_slug,
$section_slug,
$title
) {
$this->options_group_slug = $options_group_slug;
$this->section_slug = $section_slug;
$this->title = $title;
$this->load_dependencies();
$this->add_settings_groups(get_option( $this->options_group_slug ));
$this->load_options_group();
}
protected function load_dependencies(): void {
parent::load_dependencies();
require_once plugin_dir_path( __DIR__ ) . 'custom-css/class-custom-css-settings-group.php';
}
protected function add_settings_groups(): void {
$this->settings_groups = array (
CustomCSSSettingsGroup::GROUP_ID => new CustomCSSSettingsGroup($this->options_group_slug, $this->section_slug),
);
}
}