PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.1.0
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.1.0
2.1.3 2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 trunk 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 All 57 releases
darkify / public / templates / footer_script.php

footer_script.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 1.1.0, at public/templates/footer_script.php

30 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) {
3 die;
4 } // Cannot access directly.
5 $options = get_option('darkify');
6 $hide_on_desktop = $options["hide_on_desktop"];
7 $hide_on_mobile = $options["hide_on_mobile"];
8 $hide_dark_mode_on_mobile = isset($hide_on_mobile["hide_dark_mode_on_mobile"]) ? $hide_on_mobile["hide_dark_mode_on_mobile"] : 0;
9 $type_of_hide_by = isset($hide_on_mobile["type_of_hide_by"]) ? $hide_on_mobile["type_of_hide_by"] : 0;
10 ?>
11 <?php if (!is_admin()) { ?>
12 <?php if ($options["enable_dark_mode_switch"]) { ?>
13 <?php if (!$this->utils->is_hidden_by_user_agent($hide_on_desktop, $hide_dark_mode_on_mobile, $type_of_hide_by)) { ?>
14 <?php include DRK_LITE_PATH . "public/templates/views/switch.php"; ?>
15 <?php } ?>
16 <?php } ?>
17 <?php } ?>
18
19 <?php if (is_admin()) { ?>
20 <?php /* Check if block editor is on, then add the dark mode button there */ ?>
21 <?php if ($options["enable_admin_panel_dark_mode"]) {
22 if (class_exists('WP_Block_Type_Registry')) {
23 $current_screen = get_current_screen();
24 if ($current_screen && 'post' === $current_screen->base && ('post' === $current_screen->post_type || 'page' === $current_screen->post_type)) {
25 // Enqueue the script
26 wp_enqueue_script( 'darkify-editor-script', plugin_dir_url( __FILE__ ) . 'darkify-editor-script.js', array( 'wp-dom-ready', 'wp-edit-post' ), null, true );
27 }
28 }
29 } ?>
30 <?php } ?>