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

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

- Page: https://pluginprobe.com/plugins/darkify/1.4.4/code/src/Admin/Views/AdvancedSettings.php
- Raw: https://pluginprobe.com/plugins/darkify/1.4.4/raw/src/Admin/Views/AdvancedSettings.php
- Modified: 2025-06-23T10:08:10+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.4.4/code/src/Admin/Views/AdvancedSettings.php#L10-L20`.

```php
<?php

/**
 * Views class for Shortcode generator 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="https://darkifywp.com/advanced/#element_targeting" target="_blank">' . __('Live Demo', 'darkify') . '</a><a class="tooltip_btn_secondary" href="https://docs.themeatelier.net/docs/darkify-pro/darkify-settings/advanced/" target="_blank">' . __('Open Docs', 'darkify') . '</a>',
                                    'class' => 'only_pro',
                                    'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class or CSS ids. Example: div, #site-header, .my-footer', 'darkify'),
                                ),

                                array(
                                    'id' => 'allowed_elements_force_to_correct',
                                    'type'  => 'switcher',
                                    'title' => esc_html__('Force To Correct', 'darkify'),
                                    'title_help' => '<div class="darkify-info-label">' . __('Force to keep designs correct if background color or text color is changed on allowed elements.', 'darkify') . '</div>',
                                    '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',
                                    'title' => esc_html__('Disallowed Elements', 'darkify'),
                                    'title_help' => '<div class="darkify-info-label">' . __('Dark mode will be applied only to these elements.', 'darkify') . '</div>',
                                    'class' => 'only_pro',
                                    'placeholder' => esc_html__('Enter comma separated HTML tags, CSS class 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 to keep designs correct if background color or text color is not working properly for disallowed elements.', 'darkify') . '</div>',
                                    '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 these pages.', 'darkify') . '</div><div class="darkify-short-content">' . __('Choose the pages only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify') . '</div><a class="tooltip_btn_primary" href="https://darkifywp.com/advanced/#granular_control" target="_blank">' . __('Live Demo', 'darkify') . '</a><a class="tooltip_btn_secondary" href="https://docs.themeatelier.net/docs/darkify-pro/darkify-settings/advanced/#pagerestriction" target="_blank">' . __('Open Docs', 'darkify') . '</a>',
                                    'class'   => 'only_pro',
                                    'placeholder' => esc_html__('Select some pages', 'darkify'),
                                    'options'     => 'pages',
                                    'query_args'  => array(
                                        'posts_per_page' => -1,
                                    ),
                                    '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 floating switch can not work. Other pages will be able to process dark mode.', 'darkify') . '</div>',
                                    'class'   => 'only_pro',
                                    'placeholder' => esc_html__('Select some pages', 'darkify'),
                                    'options'     => 'pages',
                                    'query_args'  => array(
                                        'posts_per_page' => -1,
                                    ),
                                    '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 the posts only where dark mode and floating switch can work. No other pages will be able to process dark mode.', 'darkify') . '</div>',
                                    'class'   => 'only_pro',
                                    'placeholder' => esc_html__('Select some posts', 'darkify'),
                                    'options'     => 'posts',
                                    'query_args'  => array(
                                        'posts_per_page' => -1,
                                    ),
                                    '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 floating switch can not work. Other pages will be able to process dark mode.', 'darkify') . '</div>',
                                    'class'   => 'only_pro',
                                    'placeholder' => esc_html__('Select some posts', 'darkify'),
                                    'options'     => 'posts',
                                    'query_args'  => array(
                                        'posts_per_page' => -1,
                                    ),
                                    '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="https://darkifywp.com/advanced/#custom_css" target="_blank">' . __('Live Demo', 'darkify') . '</a><a class="tooltip_btn_secondary" href="https://docs.themeatelier.net/docs/darkify-pro/darkify-settings/advanced/#custom_css" target="_blank">' . __('Open Docs', 'darkify') . '</a>',
                                    'settings' => array(
                                        'theme'  => 'mbo',
                                        'mode'   => 'css',
                                    ),
                                ),
                                array(
                                    'id' => 'custom_css_rules',
                                    'type'  => 'switcher',
                                    'title' => esc_html__('CSS Rules', 'darkify'),
                                    'title_help'  => '<div class="darkify-info-label">' . __('CSS rules should be applied to all children of the CSS selectors.', 'darkify') . '</div><div class="darkify-short-content">' . __('Custom CSS selectors are automatically identified as Disallowed Elements, to ignore, use :not-disallowed pseudo class. i.e. body:not-disallowed{...}', 'darkify') . '</div>',
                                    'class'   => 'switcher_pro_only',
                                    'text_on' => esc_html__('Yes', 'darkify'),
                                    'text_off' => esc_html__('No', 'darkify'),
                                ),
                                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 on both normal mode and dark mode.', 'darkify') . '</div>',
                                    'settings' => array(
                                        'theme'  => 'mbo',
                                        '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__('Check this box if you would like Darkify plugin to completely remove all of its data when the plugin is deleted.', 'darkify') . '</div>',
                                ),
                                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 the options to backup your settings for safekeeping or restore them when needed. Simply export your current settings as a .json file, and import it whenever you want to restore your configuration.', 'darkify') . '</div><a class="tooltip_btn_primary" href="https://darkifywp.com/advanced/#backup" target="_blank">' . __('Live Demo', 'darkify') . '</a><a class="tooltip_btn_secondary" href="https://docs.themeatelier.net/docs/darkify-pro/darkify-settings/advanced/#backup" target="_blank">' . __('Open Docs', 'darkify') . '</a>',
                                    'type' => 'backup',
                                ),
                            )
                        ),
                    )
                ),
            ),
        ));
    }
}

```
