| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * Control class for Control options. | |
| 4 | + * Views class for Shortcode generator options. | |
| 5 | 5 | * |
| 6 | 6 | * @link https://themeatelier.net |
| 7 | 7 | * @since 1.0.0 |
| 8 | 8 | * |
| @@ -27,475 +27,154 @@ | ||
| 27 | 27 | { |
| 28 | 28 | Darkify::createSection( |
| 29 | 29 | $prefix, |
| 30 | 30 | array( |
| 31 | - 'title' => esc_html__('CONTROLS', 'darkify'), | |
| 31 | + 'title' => esc_html__('CONTROL', 'darkify'), | |
| 32 | 32 | 'icon' => 'icofont-ui-settings', |
| 33 | 33 | 'fields' => array( |
| 34 | 34 | array( |
| 35 | - 'type' => 'notice', | |
| 36 | - 'content' => __('<h3>Things Not Working as Expected?</h3>Every theme and page layout is built differently. If a section doesn’t turn dark, it’s usually using a background image, inline style, or custom CSS. Use Darkify’s control settings (color overrides, image filters, exclusions, or custom CSS) to fine-tune the result. If you still need help, <a href="https://wordpress.org/support/plugin/darkify/#new-topic-0" target="_blank">create a support topic</a> anytime—we’re happy to assist.', 'darkify'), | |
| 35 | + 'type' => 'heading', | |
| 36 | + 'content' => esc_html__('Basic Control', 'darkify'), | |
| 37 | 37 | ), |
| 38 | 38 | array( |
| 39 | - 'type' => 'section_tab', | |
| 40 | - 'tabs' => array( | |
| 41 | - | |
| 39 | + 'id' => 'enable_dark_mode_switch', | |
| 40 | + 'type' => 'switcher', | |
| 41 | + 'title' => esc_html__('Enable or Disable Frontend Dark Mode Switch', 'darkify'), | |
| 42 | + 'desc' => esc_html__('Switch to show the Dark Mode Floating Switch in your Websites frontend.', 'darkify'), | |
| 43 | + 'text_on' => esc_html__('Enabled', 'darkify-pro'), | |
| 44 | + 'text_off' => esc_html__('Disabled', 'darkify-pro'), | |
| 45 | + 'text_width' => 100, | |
| 46 | + 'default' => true, | |
| 47 | + ), | |
| 48 | + array( | |
| 49 | + 'id' => 'enable_default_dark_mode', | |
| 50 | + 'type' => 'switcher', | |
| 51 | + 'title' => esc_html__('Enable or Disable Default Dark Mode', 'darkify'), | |
| 52 | + 'desc' => esc_html__('Switch to automatically turn your website dark by default.', 'darkify'), | |
| 53 | + 'text_on' => esc_html__('Enabled', 'darkify-pro'), | |
| 54 | + 'text_off' => esc_html__('Disabled', 'darkify-pro'), | |
| 55 | + 'text_width' => 100, | |
| 56 | + ), | |
| 57 | + array( | |
| 58 | + 'id' => 'enable_os_aware', | |
| 59 | + 'type' => 'switcher', | |
| 60 | + 'title' => esc_html__('Enable or Disable OS Aware Dark Mode', 'darkify'), | |
| 61 | + 'desc' => esc_html__('Switch to enable or disable dark mode automatically according to users’ device preference.', 'darkify'), | |
| 62 | + 'text_on' => esc_html__('Enabled', 'darkify-pro'), | |
| 63 | + 'text_off' => esc_html__('Disabled', 'darkify-pro'), | |
| 64 | + 'text_width' => 100, | |
| 65 | + 'default' => true, | |
| 66 | + ), | |
| 67 | + array( | |
| 68 | + 'id' => 'enable_keyboard_shortcut', | |
| 69 | + 'type' => 'switcher', | |
| 70 | + 'title' => esc_html__('Enable or Disable Keyboard Shortcut', 'darkify'), | |
| 71 | + 'desc' => esc_html__('Switch to turn ON or OFF dark mode by pressing Ctrl+Alt+D on keyboard.', 'darkify'), | |
| 72 | + 'text_on' => esc_html__('Enabled', 'darkify-pro'), | |
| 73 | + 'text_off' => esc_html__('Disabled', 'darkify-pro'), | |
| 74 | + 'text_width' => 100, | |
| 75 | + 'default' => true, | |
| 76 | + ), | |
| 77 | + array( | |
| 78 | + 'type' => 'heading', | |
| 79 | + 'content' => esc_html__('Advanced Control', 'darkify'), | |
| 80 | + ), | |
| 81 | + | |
| 82 | + // Enable Time Based Auto Dark Mode | |
| 83 | + array( | |
| 84 | + 'id' => 'enable_time', | |
| 85 | + 'type' => 'fieldset', | |
| 86 | + 'fields' => array( | |
| 42 | 87 | array( |
| 43 | - 'title' => esc_html__('Frontend', 'darkify'), | |
| 44 | - 'icon' => 'icofont-computer', | |
| 45 | - 'fields' => array( | |
| 46 | - array( | |
| 47 | - 'type' => 'heading', | |
| 48 | - 'content' => esc_html__('Basic Controls', 'darkify'), | |
| 49 | - ), | |
| 50 | - array( | |
| 51 | - 'id' => 'enable_dark_mode_switch', | |
| 52 | - 'type' => 'switcher', | |
| 53 | - 'title' => esc_html__('Frontend Dark Mode', 'darkify'), | |
| 54 | - 'title_help' => '<div class="darkify-info-label">' . | |
| 55 | - __('Show the dark mode floating switch on your website frontend.', 'darkify') . | |
| 56 | - '</div>' . '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 57 | - esc_html__('Live Demo', 'darkify') . '</a>' . '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 58 | - esc_html__('Open Docs', 'darkify') . | |
| 59 | - '</a>', | |
| 60 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 61 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 62 | - 'text_width' => 100, | |
| 63 | - 'default' => true, | |
| 64 | - ), | |
| 65 | - array( | |
| 66 | - 'id' => 'enable_default_dark_mode', | |
| 67 | - 'type' => 'switcher', | |
| 68 | - 'title' => esc_html__('Default Dark Mode', 'darkify'), | |
| 69 | - 'title_help' => | |
| 70 | - '<div class="darkify-info-label">' . | |
| 71 | - __('Enable dark mode by default on your website.', 'darkify') . | |
| 72 | - '</div>' . | |
| 73 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 74 | - esc_html__('Live Demo', 'darkify') . | |
| 75 | - '</a>' . | |
| 76 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 77 | - esc_html__('Open Docs', 'darkify') . | |
| 78 | - '</a>', | |
| 79 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 80 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 81 | - 'text_width' => 100, | |
| 82 | - ), | |
| 83 | - array( | |
| 84 | - 'id' => 'enable_os_aware', | |
| 85 | - 'type' => 'switcher', | |
| 86 | - 'title' => esc_html__('OS Aware Dark Mode', 'darkify'), | |
| 87 | - 'title_help' => | |
| 88 | - '<div class="darkify-info-label">' . | |
| 89 | - __('Toggle dark mode based on the user’s device or operating system preference.', 'darkify') . | |
| 90 | - '</div>' . | |
| 91 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 92 | - esc_html__('Live Demo', 'darkify') . | |
| 93 | - '</a>' . | |
| 94 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 95 | - esc_html__('Open Docs', 'darkify') . | |
| 96 | - '</a>', | |
| 97 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 98 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 99 | - 'text_width' => 100, | |
| 100 | - 'default' => true, | |
| 101 | - ), | |
| 102 | - array( | |
| 103 | - 'id' => 'enable_keyboard_shortcut', | |
| 104 | - 'type' => 'switcher', | |
| 105 | - 'title' => esc_html__('Keyboard Shortcut', 'darkify'), | |
| 106 | - 'title_help' => | |
| 107 | - '<div class="darkify-info-label">' . | |
| 108 | - __('Toggle dark mode using a keyboard shortcut. Use Ctrl + Alt + D on Windows, and Control + Option + D on macOS.', 'darkify') . | |
| 109 | - '</div>' . | |
| 110 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 111 | - esc_html__('Live Demo', 'darkify') . | |
| 112 | - '</a>' . | |
| 113 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 114 | - esc_html__('Open Docs', 'darkify') . | |
| 115 | - '</a>', | |
| 116 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 117 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 118 | - 'text_width' => 100, | |
| 119 | - 'default' => true, | |
| 120 | - ), | |
| 121 | - array( | |
| 122 | - 'id' => 'enable_frontend_iframe_dark_mode', | |
| 123 | - 'type' => 'switcher', | |
| 124 | - 'title' => esc_html__('Frontend Iframe Dark Mode', 'darkify'), | |
| 125 | - 'title_help' => | |
| 126 | - '<div class="darkify-info-label">' . | |
| 127 | - __('Apply dark mode inside frontend iframes (e.g. embedded widgets or same-origin frames). Disable this if you want iframes to keep their original light appearance while the rest of the page uses dark mode.', 'darkify') . | |
| 128 | - '</div>' . | |
| 129 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 130 | - esc_html__('Live Demo', 'darkify') . | |
| 131 | - '</a>' . | |
| 132 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#basic-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 133 | - esc_html__('Open Docs', 'darkify') . | |
| 134 | - '</a>', | |
| 135 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 136 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 137 | - 'text_width' => 100, | |
| 138 | - 'default' => true, | |
| 139 | - ), | |
| 140 | - array( | |
| 141 | - 'type' => 'heading', | |
| 142 | - 'title' => esc_html__('Advanced Controls', 'darkify'), | |
| 143 | - ), | |
| 144 | - // Enable Time Based Auto Dark Mode | |
| 145 | - array( | |
| 146 | - 'id' => 'enable_time', | |
| 147 | - 'type' => 'fieldset', | |
| 148 | - 'fields' => array( | |
| 149 | - array( | |
| 150 | - 'id' => 'enable_time_based_dark', | |
| 151 | - 'type' => 'switcher', | |
| 152 | - 'title' => esc_html__('Time Based Auto Dark Mode', 'darkify'), | |
| 153 | - 'title_help' => | |
| 154 | - '<div class="darkify-info-label">' . | |
| 155 | - __('Automatically enable dark mode based on the user’s local time.', 'darkify') . | |
| 156 | - '</div>' . | |
| 157 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 158 | - esc_html__('Live Demo', 'darkify') . | |
| 159 | - '</a>' . | |
| 160 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 161 | - esc_html__('Open Docs', 'darkify') . | |
| 162 | - '</a>', | |
| 163 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 164 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 165 | - 'text_width' => 100, | |
| 166 | - ), | |
| 167 | - array( | |
| 168 | - 'id' => 'enable_time_fields', | |
| 169 | - 'type' => 'fieldset', | |
| 170 | - 'class' => 'enable_time_fields', | |
| 171 | - 'dependency' => array('enable_time_based_dark', '==', 'true'), | |
| 172 | - 'title' => esc_html__('Pick a Time', 'darkify'), | |
| 173 | - 'title_help' => | |
| 174 | - '<div class="darkify-info-label">' . | |
| 175 | - __('Set the exact start and end times when dark mode should be automatically enabled or disabled.', 'darkify') . | |
| 176 | - '</div>' . | |
| 177 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 178 | - esc_html__('Live Demo', 'darkify') . | |
| 179 | - '</a>' . | |
| 180 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 181 | - esc_html__('Open Docs', 'darkify') . | |
| 182 | - '</a>', | |
| 183 | - 'fields' => array( | |
| 184 | - array( | |
| 185 | - 'id' => 'time_based_dark_start', | |
| 186 | - 'type' => 'datetime', | |
| 187 | - 'after' => esc_html__('From', 'darkify'), | |
| 188 | - 'placeholder' => esc_html__('From', 'darkify'), | |
| 189 | - 'settings' => array( | |
| 190 | - 'noCalendar' => true, | |
| 191 | - 'enableTime' => true, | |
| 192 | - 'dateFormat' => 'H:i', | |
| 193 | - 'time_24hr' => false, | |
| 194 | - ), | |
| 195 | - ), | |
| 196 | - array( | |
| 197 | - 'id' => 'time_based_dark_end', | |
| 198 | - 'type' => 'datetime', | |
| 199 | - 'after' => esc_html__('To', 'darkify'), | |
| 200 | - 'placeholder' => esc_html__('To', 'darkify'), | |
| 201 | - 'settings' => array( | |
| 202 | - 'noCalendar' => true, | |
| 203 | - 'enableTime' => true, | |
| 204 | - 'dateFormat' => 'H:i', | |
| 205 | - 'time_24hr' => false, | |
| 206 | - ), | |
| 207 | - ), | |
| 208 | - ), | |
| 209 | - ), | |
| 210 | - ), | |
| 211 | - ), | |
| 212 | - array( | |
| 213 | - 'id' => 'hide_on_desktop', | |
| 214 | - 'type' => 'switcher', | |
| 215 | - 'title' => esc_html__('Hide Dark Mode Switch on Desktop', 'darkify'), | |
| 216 | - 'title_help' => | |
| 217 | - '<div class="darkify-info-label">' . | |
| 218 | - __('Hide the dark mode floating switch when users are browsing on a desktop or laptop.', 'darkify') . | |
| 219 | - '</div>' . | |
| 220 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 221 | - esc_html__('Live Demo', 'darkify') . | |
| 222 | - '</a>' . | |
| 223 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 224 | - esc_html__('Open Docs', 'darkify') . | |
| 225 | - '</a>', | |
| 226 | - | |
| 227 | - 'text_on' => esc_html__('Yes', 'darkify'), | |
| 228 | - 'text_off' => esc_html__('No', 'darkify'), | |
| 229 | - | |
| 230 | - ), | |
| 231 | - array( | |
| 232 | - 'id' => 'hide_on_mobile', | |
| 233 | - 'type' => 'fieldset', | |
| 234 | - 'fields' => array( | |
| 235 | - array( | |
| 236 | - 'id' => 'hide_dark_mode_on_mobile', | |
| 237 | - 'type' => 'switcher', | |
| 238 | - 'title' => esc_html__('Hide Dark Mode on Mobile', 'darkify'), | |
| 239 | - 'title_help' => | |
| 240 | - '<div class="darkify-info-label">' . | |
| 241 | - __('Hide the dark mode floating switch when users are browsing on mobile devices.', 'darkify') . | |
| 242 | - '</div>' . | |
| 243 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 244 | - esc_html__('Live Demo', 'darkify') . | |
| 245 | - '</a>' . | |
| 246 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 247 | - esc_html__('Open Docs', 'darkify') . | |
| 248 | - '</a>', | |
| 249 | - | |
| 250 | - 'text_on' => esc_html__('Yes', 'darkify'), | |
| 251 | - 'text_off' => esc_html__('No', 'darkify'), | |
| 252 | - | |
| 253 | - ), | |
| 254 | - array( | |
| 255 | - 'id' => 'type_of_hide_by', | |
| 256 | - 'type' => 'button_set', | |
| 257 | - 'title' => esc_html__('Hide Detection Method', 'darkify'), | |
| 258 | - | |
| 259 | - 'title_help' => | |
| 260 | - '<div class="darkify-info-label">' . | |
| 261 | - __('Choose how mobile devices are detected: by User Agent, by Screen Size, or use Both for maximum accuracy.', 'darkify') . | |
| 262 | - '</div>' . | |
| 263 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 264 | - esc_html__('Live Demo', 'darkify') . | |
| 265 | - '</a>' . | |
| 266 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 267 | - esc_html__('Open Docs', 'darkify') . | |
| 268 | - '</a>', | |
| 269 | - | |
| 270 | - 'options' => array( | |
| 271 | - 'user_agent' => esc_html__('User Agent', 'darkify'), | |
| 272 | - 'screen_size' => esc_html__('Screen Size', 'darkify'), | |
| 273 | - 'both' => esc_html__('Both', 'darkify'), | |
| 274 | - ), | |
| 275 | - | |
| 276 | - 'default' => 'both', | |
| 277 | - 'dependency' => array('hide_dark_mode_on_mobile', '==', 'true'), | |
| 278 | - ), | |
| 279 | - ), | |
| 280 | - ), | |
| 281 | - array( | |
| 282 | - 'id' => 'show_in_menu', | |
| 283 | - 'type' => 'fieldset', | |
| 284 | - 'fields' => array( | |
| 285 | - array( | |
| 286 | - 'id' => 'enable_switch_in_menu', | |
| 287 | - 'type' => 'switcher', | |
| 288 | - 'title' => esc_html__('Show Switch in Menu', 'darkify'), | |
| 289 | - | |
| 290 | - 'title_help' => | |
| 291 | - '<div class="darkify-info-label">' . | |
| 292 | - __('Show the dark mode toggle switch in a selected menu.', 'darkify') . | |
| 293 | - '</div>' . | |
| 294 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 295 | - esc_html__('Live Demo', 'darkify') . | |
| 296 | - '</a>' . | |
| 297 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#menu-integration') . '" target="_blank" rel="noopener noreferrer">' . | |
| 298 | - esc_html__('Open Docs', 'darkify') . | |
| 299 | - '</a>', | |
| 300 | - | |
| 301 | - 'text_on' => esc_html__('Yes', 'darkify'), | |
| 302 | - 'text_off' => esc_html__('No', 'darkify'), | |
| 303 | - | |
| 304 | - ), | |
| 305 | - array( | |
| 306 | - 'id' => 'select_menus', | |
| 307 | - 'type' => 'group', | |
| 308 | - 'title' => esc_html__('Menu Switch Settings', 'darkify'), | |
| 309 | - | |
| 310 | - 'title_help' => | |
| 311 | - '<div class="darkify-info-label">' . | |
| 312 | - __('Configure menu switch options and placement for your site.', 'darkify') . | |
| 313 | - '</div>' . | |
| 314 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 315 | - esc_html__('Live Demo', 'darkify') . | |
| 316 | - '</a>' . | |
| 317 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#menu-integration') . '" target="_blank" rel="noopener noreferrer">' . | |
| 318 | - esc_html__('Open Docs', 'darkify') . | |
| 319 | - '</a>', | |
| 320 | - | |
| 321 | - 'add_more_text' => sprintf( | |
| 322 | - /* translators: %s: URL to the Darkify Pro pricing page. */ | |
| 323 | - __( | |
| 324 | - 'Want to use the switch in an unlimited number of menus? <a target="_blank" href="%s"><strong>Upgrade to Pro</strong></a>.', | |
| 325 | - 'darkify' | |
| 326 | - ), | |
| 327 | - esc_url(DARKIFY_DEMO_URL . 'pricing/?ref=1') | |
| 328 | - ), | |
| 329 | - | |
| 330 | - 'accordion_title_number' => true, | |
| 331 | - 'accordion_title_auto' => true, | |
| 332 | - 'class' => 'select_menus', | |
| 333 | - 'max' => 1, | |
| 334 | - | |
| 335 | - 'fields' => array( | |
| 336 | - array( | |
| 337 | - 'id' => 'switch_in_menu_location', | |
| 338 | - 'type' => 'select', | |
| 339 | - 'class' => 'select_menu_location', | |
| 340 | - 'title' => esc_html__('Select Menu', 'darkify'), | |
| 341 | - 'title_help' => | |
| 342 | - '<div class="darkify-info-label">' . | |
| 343 | - esc_html__('Choose a menu from the dropdown list.', 'darkify') . | |
| 344 | - '</div>' . | |
| 345 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 346 | - esc_html__('Live Demo', 'darkify') . | |
| 347 | - '</a>' . | |
| 348 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#menu-integration') . '" target="_blank" rel="noopener noreferrer">' . | |
| 349 | - esc_html__('Open Docs', 'darkify') . | |
| 350 | - '</a>', | |
| 351 | - 'empty_message' => esc_html__( | |
| 352 | - 'You have not created a menu yet. If you are using a Full Site Editing (FSE) theme, copy the shortcode below and paste it where you want the switch to appear.', | |
| 353 | - 'darkify' | |
| 354 | - ), | |
| 355 | - 'options' => 'menus', | |
| 356 | - ), | |
| 357 | - array( | |
| 358 | - 'id' => 'darkify_menu_shortcode_helper', | |
| 359 | - 'type' => 'textarea', | |
| 360 | - 'title' => esc_html__('Shortcode for Menu', 'darkify'), | |
| 361 | - 'title_help' => | |
| 362 | - '<div class="darkify-info-label">' . | |
| 363 | - __('You can customize the shortcode options based on your preference.', 'darkify') . | |
| 364 | - '</div>' . | |
| 365 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 366 | - esc_html__('Live Demo', 'darkify') . | |
| 367 | - '</a>' . | |
| 368 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#menu-integration') . '" target="_blank" rel="noopener noreferrer">' . | |
| 369 | - esc_html__('Open Docs', 'darkify') . | |
| 370 | - '</a>', | |
| 371 | - 'default' => '[darkify switch="1" light_mode_bg="#121116" dark_mode_bg="#ffffff" light_mode_color="#ffffff" dark_mode_color="#121116" border="0px" border_light_color="#121119" border_dark_color="#ffffff" border_radius="7px" switch_size="100"]' | |
| 372 | - ), | |
| 373 | - array( | |
| 374 | - 'id' => 'select_menu_position', | |
| 375 | - 'type' => 'button_set', | |
| 376 | - 'title' => esc_html__('Select Menu Position', 'darkify'), | |
| 377 | - 'title_help' => | |
| 378 | - '<div class="darkify-info-label">' . | |
| 379 | - esc_html__('Choose where the dark mode switch should appear in the menu.', 'darkify') . | |
| 380 | - '</div>' . | |
| 381 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#advanced-control-options') . '" target="_blank" rel="noopener noreferrer">' . | |
| 382 | - esc_html__('Live Demo', 'darkify') . | |
| 383 | - '</a>' . | |
| 384 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'control/#menu-integration') . '" target="_blank" rel="noopener noreferrer">' . | |
| 385 | - esc_html__('Open Docs', 'darkify') . | |
| 386 | - '</a>', | |
| 387 | - | |
| 388 | - 'options' => array( | |
| 389 | - 'after' => esc_html__('After', 'darkify'), | |
| 390 | - 'before' => esc_html__('Before', 'darkify'), | |
| 391 | - ), | |
| 392 | - | |
| 393 | - 'default' => 'after', | |
| 394 | - ), | |
| 395 | - ), | |
| 396 | - 'dependency' => array('enable_switch_in_menu', '==', 'true'), | |
| 397 | - ), | |
| 398 | - ), | |
| 399 | - ), | |
| 88 | + 'id' => 'enable_time_based_dark', | |
| 89 | + 'type' => 'switcher', | |
| 90 | + 'title' => esc_html__('Enable or Disable Time Based Auto Dark Mode', 'darkify'), | |
| 91 | + 'desc' => esc_html__('Automatically turn dark mode ON based on users’ localtime.', 'darkify'), | |
| 92 | + 'text_on' => esc_html__('Enabled', 'darkify-pro'), | |
| 93 | + 'text_off' => esc_html__('Disabled', 'darkify-pro'), | |
| 94 | + 'text_width' => 100, | |
| 95 | + ), | |
| 96 | + array( | |
| 97 | + 'id' => 'time_based_dark_start', | |
| 98 | + 'type' => 'datetime', | |
| 99 | + 'title' => esc_html__('Pick a Time', 'darkify'), | |
| 100 | + 'from_to' => true, | |
| 101 | + 'text_from' => esc_html__('Form', 'darkify'), | |
| 102 | + 'text_to' => esc_html__('To', 'darkify'), | |
| 103 | + 'settings' => array( | |
| 104 | + 'noCalendar' => true, | |
| 105 | + 'enableTime' => true, | |
| 106 | + 'dateFormat' => 'H:i', | |
| 107 | + 'time_24hr' => false, | |
| 400 | 108 | ), |
| 109 | + 'dependency' => array('enable_time_based_dark', '==', 'true'), | |
| 401 | 110 | ), |
| 111 | + ), | |
| 112 | + ), | |
| 113 | + array( | |
| 114 | + 'id' => 'hide_on_desktop', | |
| 115 | + 'type' => 'switcher', | |
| 116 | + 'title' => esc_html__('Show or Hide Dark Mode Switch on Desktop', 'darkify'), | |
| 117 | + 'desc' => esc_html__('Switch to hide the Dark Mode Floating Switch if users’ are using desktop or laptop.', 'darkify'), | |
| 118 | + 'text_on' => esc_html__('Show', 'darkify-pro'), | |
| 119 | + 'text_off' => esc_html__('Hide', 'darkify-pro'), | |
| 120 | + 'text_width' => 80, | |
| 121 | + ), | |
| 122 | + array( | |
| 123 | + 'id' => 'hide_on_mobile', | |
| 124 | + 'type' => 'fieldset', | |
| 125 | + 'fields' => array( | |
| 402 | 126 | array( |
| 403 | - 'title' => esc_html__('Admin', 'darkify'), | |
| 404 | - 'icon' => 'icofont-dashboard-web', | |
| 405 | - 'fields' => array( | |
| 406 | - array( | |
| 407 | - 'id' => 'enable_admin_panel_dark_mode', | |
| 408 | - 'type' => 'switcher', | |
| 409 | - 'title' => esc_html__('Admin Panel Dark Mode', 'darkify'), | |
| 410 | - 'title_help' => | |
| 411 | - '<div class="darkify-info-label">' . | |
| 412 | - __('Enable dark mode in the WordPress admin dashboard.', 'darkify') . | |
| 413 | - '</div>' . | |
| 414 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#admin') . '" target="_blank" rel="noopener noreferrer">' . | |
| 415 | - esc_html__('Live Demo', 'darkify') . | |
| 416 | - '</a>' . | |
| 417 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'controls/#admin-controls') . '" target="_blank" rel="noopener noreferrer">' . | |
| 418 | - esc_html__('Open Docs', 'darkify') . | |
| 419 | - '</a>', | |
| 420 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 421 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 422 | - 'default' => false, | |
| 423 | - 'text_width' => 100, | |
| 424 | - ), | |
| 425 | - | |
| 426 | - array( | |
| 427 | - 'id' => 'block_editor_dark_mode', | |
| 428 | - 'type' => 'switcher', | |
| 429 | - 'title' => esc_html__('Block Editor Dark Mode', 'darkify'), | |
| 430 | - 'title_help' => | |
| 431 | - '<div class="darkify-info-label">' . | |
| 432 | - __('Enable the dark mode switch in the block editor to toggle between dark and light mode.', 'darkify') . | |
| 433 | - '</div>' . | |
| 434 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#admin') . '" target="_blank" rel="noopener noreferrer">' . | |
| 435 | - esc_html__('Live Demo', 'darkify') . | |
| 436 | - '</a>' . | |
| 437 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#admin') . '" target="_blank" rel="noopener noreferrer">' . | |
| 438 | - esc_html__('Open Docs', 'darkify') . | |
| 439 | - '</a>', | |
| 440 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 441 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 442 | - 'default' => true, | |
| 443 | - 'text_width' => 100, | |
| 444 | - 'dependency' => array('enable_admin_panel_dark_mode', '==', 'true'), | |
| 445 | - ), | |
| 446 | - array( | |
| 447 | - 'id' => 'classic_editor_dark_mode', | |
| 448 | - 'type' => 'switcher', | |
| 449 | - 'title' => esc_html__('Classic Editor Dark Mode', 'darkify'), | |
| 450 | - 'title_help' => | |
| 451 | - '<div class="darkify-info-label">' . | |
| 452 | - __('Enable the dark mode switch in the classic editor to toggle between dark and light modes.', 'darkify') . | |
| 453 | - '</div>' . | |
| 454 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#admin') . '" target="_blank" rel="noopener noreferrer">' . | |
| 455 | - esc_html__('Live Demo', 'darkify') . | |
| 456 | - '</a>' . | |
| 457 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#admin') . '" target="_blank" rel="noopener noreferrer">' . | |
| 458 | - esc_html__('Open Docs', 'darkify') . | |
| 459 | - '</a>', | |
| 460 | - 'text_on' => esc_html__('Enabled', 'darkify'), | |
| 461 | - 'text_off' => esc_html__('Disabled', 'darkify'), | |
| 462 | - | |
| 463 | - 'default' => true, | |
| 464 | - 'text_width' => 100, | |
| 465 | - ), | |
| 466 | - | |
| 467 | - array( | |
| 468 | - 'id' => 'disallowed_admin_pages', | |
| 469 | - 'type' => 'textarea', | |
| 470 | - 'title' => esc_html__('Disallowed Pages', 'darkify'), | |
| 471 | - 'title_help' => '<div class="darkify-info-text">' . | |
| 472 | - __('If an admin page URL looks like http://example.com/wp-admin/admin.php?page=darkify, then "darkify" is the page slug.', 'darkify') . | |
| 473 | - '</div>' . | |
| 474 | - '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'controls/#admin') . '" target="_blank" rel="noopener noreferrer">' . | |
| 475 | - esc_html__('Live Demo', 'darkify') . | |
| 476 | - '</a>' . | |
| 477 | - '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'controls/#admin-controls') . '" target="_blank" rel="noopener noreferrer">' . | |
| 478 | - esc_html__('Open Docs', 'darkify') . | |
| 479 | - '</a>', | |
| 480 | - 'placeholder' => esc_html__('Enter comma-separated page slugs. Example: darkify-dashboard, elementor', 'darkify'), | |
| 481 | - 'dependency' => array('enable_admin_panel_dark_mode', '==', 'true'), | |
| 482 | - 'class' => 'only_pro' | |
| 483 | - ), | |
| 484 | - array( | |
| 485 | - 'id' => 'admin_custom_css', | |
| 486 | - 'type' => 'code_editor', | |
| 487 | - 'title' => esc_html__('Admin Dark Mode CSS', 'darkify'), | |
| 488 | - 'title_help' => | |
| 489 | - '<div class="darkify-info-label">' . | |
| 490 | - __('The CSS code will only be applied when admin dark mode is active.', 'darkify') . | |
| 491 | - '</div>', | |
| 492 | - 'settings' => array( | |
| 493 | - 'theme' => 'mbo', | |
| 494 | - 'mode' => 'css', | |
| 495 | - ), | |
| 496 | - ), | |
| 127 | + 'id' => 'hide_dark_mode_on_mobile', | |
| 128 | + 'type' => 'switcher', | |
| 129 | + 'title' => esc_html__('Show or Hide Dark Mode on Mobile', 'darkify'), | |
| 130 | + 'desc' => esc_html__('Switch to hide the Dark Mode Floating Switch if users’ are using mobile.', 'darkify'), | |
| 131 | + 'text_on' => esc_html__('Show', 'darkify-pro'), | |
| 132 | + 'text_off' => esc_html__('Hide', 'darkify-pro'), | |
| 133 | + 'text_width' => 80, | |
| 134 | + ), | |
| 135 | + array( | |
| 136 | + 'id' => 'type_of_hide_by', | |
| 137 | + 'type' => 'select', | |
| 138 | + 'title' => esc_html__('Type of Hide By', 'darkify'), | |
| 139 | + 'options' => array( | |
| 140 | + 'user_agent' => esc_html__('Hide by User Agent', 'darkify'), | |
| 141 | + 'screen_size' => esc_html__('Hide by Screen Size', 'darkify'), | |
| 142 | + 'both' => esc_html__('Hide by Both', 'darkify'), | |
| 497 | 143 | ), |
| 144 | + 'default' => 'both', | |
| 145 | + 'dependency' => array('hide_dark_mode_on_mobile', '==', 'true'), | |
| 146 | + ), | |
| 147 | + ), | |
| 148 | + ), | |
| 149 | + | |
| 150 | + array( | |
| 151 | + 'id' => 'show_in_menu', | |
| 152 | + 'type' => 'fieldset', | |
| 153 | + 'fields' => array( | |
| 154 | + array( | |
| 155 | + 'id' => 'enable_switch_in_menu', | |
| 156 | + 'type' => 'switcher', | |
| 157 | + 'title' => esc_html__('Show or Hide Switch in Menu', 'darkify'), | |
| 158 | + 'desc' => esc_html__('Show the dark mode toggle switch in specific menu.', 'darkify'), | |
| 159 | + 'text_on' => esc_html__('Show', 'darkify-pro'), | |
| 160 | + 'text_off' => esc_html__('Hide', 'darkify-pro'), | |
| 161 | + 'text_width' => 80, | |
| 162 | + ), | |
| 163 | + array( | |
| 164 | + 'id' => 'switch_in_menu_location', | |
| 165 | + 'type' => 'select', | |
| 166 | + 'title' => esc_html__('Select Menu', 'darkify'), | |
| 167 | + 'options' => 'menus', | |
| 168 | + 'dependency' => array('enable_switch_in_menu', '==', 'true'), | |
| 169 | + ), | |
| 170 | + array( | |
| 171 | + 'id' => 'darkify_menu_shortcode_helper', | |
| 172 | + 'type' => 'textarea', | |
| 173 | + 'title' => esc_html__('Short Code menu', 'darkify'), | |
| 174 | + 'desc' => esc_html__('You can generate customized switch shortcode from SWITCH STYLE > Advanced Customization.', 'darkify'), | |
| 175 | + 'dependency' => array('enable_switch_in_menu', '==', 'true'), | |
| 176 | + 'default' => '[darkify switch="1" width_height="60px" border_radius="7px" icon_size="40px" light_mode_bg="#121116" dark_mode_bg="#ffffff" light_mode_color="#ffffff" dark_mode_color="#121116"]' | |
| 498 | 177 | ), |
| 499 | 178 | ), |
| 500 | 179 | ), |
| 501 | 180 | ), |