# darkify/1.5.2/src/Admin/Views/AdvancedSettings.php

Darkify – Dark Mode &amp; Night Mode for Website &amp; Admin (Dark Theme Included), version 1.5.2. 335 lines.

- Page: https://pluginprobe.com/plugins/darkify/1.5.2/code/src/Admin/Views/AdvancedSettings.php
- Raw: https://pluginprobe.com/plugins/darkify/1.5.2/raw/src/Admin/Views/AdvancedSettings.php
- Modified: 2026-05-05T12:34:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/darkify/1.5.2/code/src/Admin/Views/AdvancedSettings.php#L10-L20`.

```php
<?php

/**
 * AdvancedSettings class for Advanced options.
 *
 * @link       https://themeatelier.net
 * @since      1.0.0
 *
 * @package     darkify
 * @subpackage darkify/src/Admin/Views/AdvancedSettings
 * @author     ThemeAtelier<themeatelierbd@gmail.com>
 */

namespace ThemeAtelier\Darkify\Admin\Views;

use ThemeAtelier\Darkify\Admin\Framework\Classes\Darkify;

class AdvancedSettings
{
    /**
     * Create Option fields for the setting options.
     *
     * @param string $prefix Option setting key prefix.
     * @return void
     */
    public static function options($prefix)
    {
        Darkify::createSection($prefix, array(
            'title'  => esc_html__('ADVANCED', 'darkify'),
            'icon'   => 'icofont-settings',
            'fields' => array(
                array(
                    'type' => 'section_tab',
                    'tabs' => array(
                        array(
                            'title' => esc_html__('HTML/CSS Restriction', 'darkify'),
                            'icon'  => 'icofont-code-alt',
                            'fields' => array(
                                // ALLOWED ELEMENTS
                                array(
                                    'id' => 'allowed_elements',
                                    'type'  => 'textarea',
                                    'title' => esc_html__('Allow Only Elements', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        __('Dark mode will be applied only to these elements.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',
                                    'placeholder' => esc_html__(
                                        'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer',
                                        'darkify'
                                    ),


                                    'class' => 'only_pro',
                                ),

                                array(
                                    'id' => 'allowed_elements_force_to_correct',
                                    'type'  => 'switcher',
                                    'title' => esc_html__('Force Design Correction', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        __('Force Darkify to preserve layout and readability when background or text colors are modified on allowed elements.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'class'   => 'switcher_pro_only',
                                    'text_on' => esc_html__('Yes', 'darkify'),
                                    'text_off' => esc_html__('No', 'darkify'),
                                    'default' => true,
                                ),

                                // DISALLOWED ELEMENTS
                                array(
                                    'id' => 'disallowed_elements',
                                    'type'  => 'textarea',
                                    'class' => 'only_pro',
                                    'title' => esc_html__('Disallowed Elements', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        esc_html__('Dark mode will NOT be applied to the elements.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
                                        esc_html__('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
                                        esc_html__('Open Docs', 'darkify') .
                                        '</a>',

                                    'placeholder' => esc_html__(
                                        'Enter comma-separated HTML tags, CSS classes, or CSS IDs. Example: div, #site-header, .my-footer',
                                        'darkify'
                                    ),

                                ),

                                array(
                                    'id' => 'disallowed_elements_force_to_correct',
                                    'type'  => 'switcher',
                                    'title' => esc_html__('Force To Correct', 'darkify'),
                                    'title_help' => '<div class="darkify-info-label">' .
                                        __('Force Darkify to keep the design correct when background or text colors do not work properly for disallowed elements.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#element_targeting" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#html-css-restriction" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'class'   => 'switcher_pro_only',
                                    'text_on' => esc_html__('Yes', 'darkify'),
                                    'text_off' => esc_html__('No', 'darkify'),
                                    'default' => true,
                                ),
                            )
                        ),

                        array(
                            'title' => esc_html__('Page/Posts Restriction', 'darkify'),
                            'icon'  => 'icofont-eye-blocked',
                            'fields' => array(
                                array(
                                    'type' => 'heading',
                                    'title'  => esc_html__('Pages Restriction', 'darkify'),
                                ),
                                array(
                                    'id' => 'allowed_pages',
                                    'type'  => 'select',
                                    'title' => esc_html__('Allow Only Pages', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        __('Dark mode will be applied only to the selected pages.', 'darkify') .
                                        '</div><div class="darkify-short-content">' .
                                        __('Choose only the pages where dark mode and the floating switch should work. Dark mode will not be applied to any other pages.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#pages-restriction" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',
                                    'placeholder' => esc_html__('Select pages', 'darkify'),

                                    'class'   => 'only_pro',
                                    'options'     => 'pages',
                                    'chosen'      => true,
                                    'multiple'    => true,
                                ),

                                array(
                                    'id' => 'disallowed_pages',
                                    'type'  => 'select',
                                    'title' => esc_html__('Disallowed Pages', 'darkify'),
                                    'title_help'  =>
                                    '<div class="darkify-info-label">' .
                                        __('Dark mode will not be applied to these pages.', 'darkify') .
                                        '</div><div class="darkify-short-content">' .
                                        __('Choose the pages where dark mode and the floating switch should not work. Dark mode will work on all other pages.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#pages-restriction" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'class'   => 'only_pro',
                                    'placeholder' => esc_html__('Select pages', 'darkify'),
                                    'options'     => 'pages',
                                    'chosen'      => true,
                                    'multiple'    => true,
                                    'dependency' => array('allowed_pages', '==', ''),
                                ),

                                array(
                                    'type' => 'heading',
                                    'title'  => esc_html__('Posts Restriction', 'darkify'),
                                ),
                                array(
                                    'id' => 'allowed_posts',
                                    'type'  => 'select',
                                    'title' => esc_html__('Allow Only Posts', 'darkify'),
                                    'title_help'  =>
                                    '<div class="darkify-info-label">' .
                                        __('Dark mode will be applied only to these posts.', 'darkify') .
                                        '</div><div class="darkify-short-content">' .
                                        __('Choose only the posts where dark mode and the floating switch should work. Dark mode will not be applied to any other posts.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#posts-restriction" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'placeholder' => esc_html__('Select posts', 'darkify'),
                                    'class'   => 'only_pro',
                                    'options'     => 'posts',
                                    'chosen'      => true,
                                    'multiple'    => true,
                                ),
                                array(
                                    'id' => 'disallowed_posts',
                                    'type'  => 'select',
                                    'title' => esc_html__('Disallowed Posts', 'darkify'),
                                    'title_help'  =>
                                    '<div class="darkify-info-label">' .
                                        __('Dark mode will not be applied to these posts.', 'darkify') .
                                        '</div><div class="darkify-short-content">' .
                                        __('Choose the posts where dark mode and the floating switch cannot work. Other posts will be able to process dark mode.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#granular_control" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#posts-restriction" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',
                                    'placeholder' => esc_html__('Select posts', 'darkify'),
                                    'class'   => 'only_pro',
                                    'options'     => 'posts',
                                    'chosen'      => true,
                                    'multiple'    => true,
                                    'dependency' => array('allowed_posts', '==', ''),
                                ),
                            )
                        ),
                        array(
                            'title' => esc_html__('Custom CSS', 'darkify'),
                            'icon'  => 'icofont-file-css',
                            'fields' => array(
                                array(
                                    'id'       => 'custom_css',
                                    'type'     => 'code_editor',
                                    'title' => esc_html__('Dark Mode CSS', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        __('The CSS code will only be applied when dark mode is active.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#custom_css" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#custom-css" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'settings' => array(
                                        'theme'  => 'default',
                                        'mode'   => 'css',
                                    ),
                                ),
                                array(
                                    'id' => 'custom_css_rules',
                                    'type'  => 'switcher',
                                    'title' => esc_html__('CSS Rules', 'darkify'),

                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        __('CSS rules will be applied to all child elements of the specified CSS selectors.', 'darkify') .
                                        '</div>' .
                                        '<div class="darkify-short-content">' .
                                        __('Custom CSS selectors are automatically treated as Disallowed Elements. To override this behavior, use the :not-disallowed pseudo-class. Example: body:not-disallowed { ... }', 'darkify') .
                                        '</div>' .
                                        '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#custom_css" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a>' .
                                        '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#custom-css" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'text_on'  => esc_html__('Yes', 'darkify'),
                                    'text_off' => esc_html__('No', 'darkify'),

                                    'class'   => 'switcher_pro_only',
                                ),
                                array(
                                    'id'       => 'normal_custom_css',
                                    'type'     => 'code_editor',
                                    'title' => esc_html__('Normal Mode CSS', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        __('The CSS code will be applied in both normal mode and dark mode.', 'darkify') .
                                        '</div>' .
                                        '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#custom_css" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a>' .
                                        '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#custom-css" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'settings' => array(
                                        'theme'  => 'default',
                                        'mode'   => 'css',
                                    ),
                                ),
                            )
                        ),
                        array(
                            'title' => esc_html__('Extras', 'darkify'),
                            'icon'  => 'icofont-holding-hands',
                            'fields' => array(
                                // Enable Tooltip On Floating Switch
                                array(
                                    'id'    => 'darkify_data_remove',
                                    'type'    => 'checkbox',
                                    'title' => esc_html__('Clean-up Data on Deletion', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        esc_html__('Enable this option to completely remove all Darkify data when the plugin is deleted.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#backup" target="_blank">' .
                                        esc_html__('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#extras" target="_blank">' .
                                        esc_html__('Open Docs', 'darkify') .
                                        '</a>',

                                ),
                                array(
                                    'type' => 'heading',
                                    'title'  => esc_html__('Backup', 'darkify'),
                                ),
                                array(
                                    'title' => esc_html__('Backup and Restore Settings', 'darkify'),
                                    'title_help' =>
                                    '<div class="darkify-info-label">' .
                                        esc_html__('Use these options to back up your settings for safekeeping or restore them when needed. You can export your current settings as a .json file and import it anytime to restore your configuration.', 'darkify') .
                                        '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'advanced/#backup" target="_blank">' .
                                        __('Live Demo', 'darkify') .
                                        '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'advanced/#extras" target="_blank">' .
                                        __('Open Docs', 'darkify') .
                                        '</a>',

                                    'type' => 'backup',
                                ),
                            )
                        ),
                    )
                ),
            ),
        ));
    }
}

```
