PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.0
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.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 / src / Helpers / DarkifyExternalSupport.php

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

183 lines 6.1 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\Helpers;
4
5 if (! class_exists('DarkifyExternalSupport')) {
6 class DarkifyExternalSupport
7 {
8
9 public $base_admin;
10 public function __construct($base_admin)
11 {
12 $this->base_admin = $base_admin;
13 }
14
15 public function getDisallowedElementsByAvailablePlugins(){
16 $disallowed_elements = array();
17
18 /* =============== Default Darkify Ignore =============== */
19 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByDarkify());
20
21 /* =============== Logged-in as Admin =============== */
22 if(function_exists("is_admin_bar_showing")){
23 if(is_admin_bar_showing()){
24 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminLogin());
25 }
26 }
27
28 /* =============== Is in Admin Panel =============== */
29 if(function_exists("is_admin")){
30 if(is_admin()){
31 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByAdminPanel());
32 }
33 }
34
35 /* =============== Elementor =============== */
36 if(function_exists("is_plugin_active")){
37 if (is_plugin_active( 'elementor/elementor.php' )) {
38 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByElementor());
39 }
40 }
41
42 /* =============== Beaver Builder =============== */
43 if ( class_exists( 'FLBuilder' ) ) {
44 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByBeaver());
45 }
46
47 /* =============== Block Editor =============== */
48 if(function_exists("has_blocks")){
49 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByBlockEditor());
50 }
51
52 /* =============== Slider Revolution =============== */
53 if(class_exists('RevSliderFront')){
54 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByRevSlider());
55 }
56
57 /* =============== OneSignal Push Notifications =============== */
58 if(class_exists('OneSignal_Public')){
59 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByOneSignal());
60 }
61
62 /* =============== Read Meter =============== */
63 if(class_exists('BSFRT_Loader')){
64 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByReadMeter());
65 }
66
67
68 return $disallowed_elements;
69 }
70
71 /* =============== Default Darkify Ignore =============== */
72 public function getDisallowedElementsByDarkify()
73 {
74 return array(
75 ".darkify_ignore",
76 ".darkify_ignore *",
77 ".darkify_switch",
78 ".darkify_switch *",
79 );
80 }
81
82 /* =============== Logged-in as Admin =============== */
83 public function getDisallowedElementsByAdminLogin()
84 {
85 return array(
86 "#wpadminbar",
87 "#wpadminbar *",
88 );
89 }
90
91 /* =============== Is in Admin Panel =============== */
92 public function getDisallowedElementsByAdminPanel()
93 {
94 return array(
95 "#wpadminbar",
96 "#wpadminbar *",
97 "#adminmenumain",
98 "#adminmenumain *",
99 ".wp-core-ui .button-primary",
100 ".wp-core-ui .button-primary *",
101 ".post-com-count-approved",
102 ".post-com-count-approved *",
103 ".darkify--switcher",
104 ".darkify--switcher *",
105 ".darkify-slider-ui",
106 ".darkify-slider-ui *",
107 ".CodeMirror",
108 ".CodeMirror *",
109 ".wp-picker-container",
110 ".wp-picker-container *",
111 ".darkify--sibling.darkify--image *",
112 ".darkify_preset .darkify--sibling",
113 ".darkify_preset .darkify--sibling *",
114 ".button",
115 ".darkify-tooltip",
116 ".darkify-tooltip *",
117 );
118 }
119
120
121 /* =============== Elementor =============== */
122 public function getDisallowedElementsByElementor()
123 {
124 return array(
125 ".elementor-background-overlay",
126 ".elementor-element-overlay",
127 ".elementor-button-link",
128 ".elementor-button-link *",
129 ".elementor-widget-spacer",
130 ".elementor-widget-spacer *",
131 );
132 }
133
134
135
136 /* =============== Beaver Builder =============== */
137 public function getDisallowedElementsByBeaver()
138 {
139 return array(
140 ".uabb-button",
141 ".uabb-button *",
142 );
143 }
144
145
146 /* =============== Block Editor =============== */
147 public function getDisallowedElementsByBlockEditor()
148 {
149 return array(
150 ".wp-block-button__link",
151 ".wp-block-button__link *",
152 );
153 }
154
155 /* =============== Slider Revolution =============== */
156 public function getDisallowedElementsByRevSlider()
157 {
158 return array(
159 "rs-fullwidth-wrap",
160 "rs-fullwidth-wrap *",
161 );
162 }
163
164 /* =============== OneSignal Push Notifications =============== */
165 public function getDisallowedElementsByOneSignal()
166 {
167 return array(
168 ".onesignal-slidedown-dialog",
169 ".onesignal-slidedown-dialog *",
170 );
171 }
172
173 /* =============== Read Meter =============== */
174 public function getDisallowedElementsByReadMeter()
175 {
176 return array(
177 "#bsf_rt_progress_bar_container",
178 "#bsf_rt_progress_bar_container *",
179 );
180 }
181 }
182 }
183