PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.4.21
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.4.21
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) 1.4.21, at src/Includes/DarkifyExternalSupport.php

168 lines 5.6 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 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 /* =============== Slider Revolution =============== */
48 if(class_exists('RevSliderFront')){
49 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByRevSlider());
50 }
51
52 /* =============== OneSignal Push Notifications =============== */
53 if(class_exists('OneSignal_Public')){
54 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByOneSignal());
55 }
56
57 /* =============== Read Meter =============== */
58 if(class_exists('BSFRT_Loader')){
59 $disallowed_elements = array_merge($disallowed_elements, $this->getDisallowedElementsByReadMeter());
60 }
61
62
63 return $disallowed_elements;
64 }
65
66 /* =============== Default Darkify Ignore =============== */
67 public function getDisallowedElementsByDarkify()
68 {
69 return array(
70 ".darkify_ignore",
71 ".darkify_ignore *",
72 ".darkify_switch",
73 ".darkify_switch *",
74 );
75 }
76
77 /* =============== Logged-in as Admin =============== */
78 public function getDisallowedElementsByAdminLogin()
79 {
80 return array(
81 "#wpadminbar",
82 "#wpadminbar *",
83 );
84 }
85
86 /* =============== Is in Admin Panel =============== */
87 public function getDisallowedElementsByAdminPanel()
88 {
89 return array(
90 "#wpadminbar",
91 "#wpadminbar *",
92 "#adminmenumain",
93 "#adminmenumain *",
94 ".wp-core-ui .button-primary",
95 ".wp-core-ui .button-primary *",
96 ".post-com-count-approved",
97 ".post-com-count-approved *",
98 ".darkify--switcher",
99 ".darkify--switcher *",
100 ".darkify-slider-ui",
101 ".darkify-slider-ui *",
102 ".CodeMirror",
103 ".CodeMirror *",
104 ".wp-picker-container",
105 ".wp-picker-container *",
106 ".darkify--sibling.darkify--image *",
107 ".darkify_preset .darkify--sibling",
108 ".darkify_preset .darkify--sibling *",
109 ".button",
110 ".darkify-tooltip",
111 ".darkify-tooltip *",
112 );
113 }
114
115
116 /* =============== Elementor =============== */
117 public function getDisallowedElementsByElementor()
118 {
119 return array(
120 ".elementor-background-overlay",
121 ".elementor-element-overlay",
122 // ".elementor-button-link",
123 // ".elementor-button-link *",
124 ".elementor-widget-spacer",
125 ".elementor-widget-spacer *",
126 );
127 }
128
129
130
131 /* =============== Beaver Builder =============== */
132 public function getDisallowedElementsByBeaver()
133 {
134 return array(
135 ".uabb-button",
136 ".uabb-button *",
137 );
138 }
139
140 /* =============== Slider Revolution =============== */
141 public function getDisallowedElementsByRevSlider()
142 {
143 return array(
144 "rs-fullwidth-wrap",
145 "rs-fullwidth-wrap *",
146 );
147 }
148
149 /* =============== OneSignal Push Notifications =============== */
150 public function getDisallowedElementsByOneSignal()
151 {
152 return array(
153 ".onesignal-slidedown-dialog",
154 ".onesignal-slidedown-dialog *",
155 );
156 }
157
158 /* =============== Read Meter =============== */
159 public function getDisallowedElementsByReadMeter()
160 {
161 return array(
162 "#bsf_rt_progress_bar_container",
163 "#bsf_rt_progress_bar_container *",
164 );
165 }
166 }
167 }
168