PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 2.0.3
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v2.0.3
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 / src / Includes / DarkifyExternalSupport.php

DarkifyExternalSupport.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 2.0.3, at src/Includes/DarkifyExternalSupport.php

189 lines 6.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ThemeAtelier\Darkify\Includes;
4
5 // Abort if this file is accessed directly, outside of WordPress.
6 if (! defined('ABSPATH')) {
7 exit;
8 }
9
10 if (! class_exists('DarkifyExternalSupport')) {
11 class DarkifyExternalSupport
12 {
13
14 public $base_admin;
15 public function __construct($base_admin)
16 {
17 $this->base_admin = $base_admin;
18 }
19
20 public function getDisallowedElementsByAvailablePlugins()
21 {
22 $disallowed_elements = array();
23
24 /* =============== Default Darkify Ignore =============== */
25 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByDarkify());
26
27 /* =============== Logged-in as Admin =============== */
28 if (function_exists("is_admin_bar_showing")) {
29 if (is_admin_bar_showing()) {
30 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminLogin());
31 }
32 }
33
34 /* =============== Is in Admin Panel =============== */
35 if (function_exists("is_admin")) {
36 if (is_admin()) {
37 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminPanel());
38 }
39 }
40
41 /* =============== Elementor =============== */
42 if (function_exists("is_plugin_active")) {
43 if (is_plugin_active('elementor/elementor.php')) {
44 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByElementor());
45 }
46 }
47
48 /* =============== Beaver Builder =============== */
49 if (class_exists('FLBuilder')) {
50 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByBeaver());
51 }
52
53 /* =============== Slider Revolution =============== */
54 if (class_exists('RevSliderFront')) {
55 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByRevSlider());
56 }
57
58 /* =============== OneSignal Push Notifications =============== */
59 if (class_exists('OneSignal_Public')) {
60 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByOneSignal());
61 }
62
63 /* =============== Read Meter =============== */
64 if (class_exists('BSFRT_Loader')) {
65 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByReadMeter());
66 }
67
68
69 return $disallowed_elements;
70 }
71
72 /* =============== Default Darkify Ignore =============== */
73 public function getDisallowedElementsByDarkify()
74 {
75 return array(
76 ".darkify_ignore",
77 ".darkify_ignore *",
78 ".darkify_switch",
79 ".darkify_switch *",
80 ".wp-block-btn-button .btnButton",
81 ".wp-block-btn-button .btnButton *",
82 );
83 }
84
85 /* =============== Logged-in as Admin =============== */
86 public function getDisallowedElementsByAdminLogin()
87 {
88 return array(
89 "#wpadminbar",
90 "#wpadminbar *",
91 );
92 }
93
94 /* =============== Is in Admin Panel =============== */
95 public function getDisallowedElementsByAdminPanel()
96 {
97 return array(
98 "#wpadminbar",
99 "#wpadminbar *",
100 "#adminmenumain",
101 "#adminmenumain *",
102 ".wp-core-ui .button-primary",
103 ".wp-core-ui .button-primary *",
104 ".post-com-count-approved",
105 ".post-com-count-approved *",
106 ".darkify--switcher",
107 ".darkify--switcher *",
108 ".darkify-slider-ui",
109 ".darkify-slider-ui *",
110 ".CodeMirror",
111 ".CodeMirror *",
112 ".wp-picker-container",
113 ".wp-picker-container *",
114 ".darkify--sibling.darkify--image *",
115 ".darkify_preset .darkify--sibling",
116 ".darkify_preset .darkify--sibling *",
117 ".button",
118 ".darkify-tooltip",
119 ".darkify-tooltip *",
120 ".rll-youtube-player .play",
121 "button.components-color-palette__custom-color-button",
122 ".react-colorful__saturation",
123 ".react-colorful__hue.react-colorful__last-control",
124 ".block-editor-color-gradient-control__panel",
125 ".block-editor-color-gradient-control__panel *",
126 ".components-z-stack",
127 ".components-z-stack *",
128 ".theme_color",
129 ".themeatelier_license_notice",
130 ".themeatelier_license_notice *",
131 "#themeatelier-offer-banner",
132 "#themeatelier-offer-banner *",
133 );
134 }
135
136
137 /* =============== Elementor =============== */
138 public function getDisallowedElementsByElementor()
139 {
140 return array(
141 ".elementor-background-overlay",
142 ".elementor-element-overlay",
143 // ".elementor-button-link",
144 // ".elementor-button-link *",
145 ".elementor-widget-spacer",
146 ".elementor-widget-spacer *",
147 );
148 }
149
150
151
152 /* =============== Beaver Builder =============== */
153 public function getDisallowedElementsByBeaver()
154 {
155 return array(
156 ".uabb-button",
157 ".uabb-button *",
158 );
159 }
160
161 /* =============== Slider Revolution =============== */
162 public function getDisallowedElementsByRevSlider()
163 {
164 return array(
165 "rs-fullwidth-wrap",
166 "rs-fullwidth-wrap *",
167 );
168 }
169
170 /* =============== OneSignal Push Notifications =============== */
171 public function getDisallowedElementsByOneSignal()
172 {
173 return array(
174 ".onesignal-slidedown-dialog",
175 ".onesignal-slidedown-dialog *",
176 );
177 }
178
179 /* =============== Read Meter =============== */
180 public function getDisallowedElementsByReadMeter()
181 {
182 return array(
183 "#bsf_rt_progress_bar_container",
184 "#bsf_rt_progress_bar_container *",
185 );
186 }
187 }
188 }
189