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

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

171 lines 5.8 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 ".wp-block-btn-button .btnButton",
75 ".wp-block-btn-button .btnButton *",
76 );
77 }
78
79 /* =============== Logged-in as Admin =============== */
80 public function getDisallowedElementsByAdminLogin()
81 {
82 return array(
83 "#wpadminbar",
84 "#wpadminbar *",
85 );
86 }
87
88 /* =============== Is in Admin Panel =============== */
89 public function getDisallowedElementsByAdminPanel()
90 {
91 return array(
92 "#wpadminbar",
93 "#wpadminbar *",
94 "#adminmenumain",
95 "#adminmenumain *",
96 ".wp-core-ui .button-primary",
97 ".wp-core-ui .button-primary *",
98 ".post-com-count-approved",
99 ".post-com-count-approved *",
100 ".darkify--switcher",
101 ".darkify--switcher *",
102 ".darkify-slider-ui",
103 ".darkify-slider-ui *",
104 ".CodeMirror",
105 ".CodeMirror *",
106 ".wp-picker-container",
107 ".wp-picker-container *",
108 ".darkify--sibling.darkify--image *",
109 ".darkify_preset .darkify--sibling",
110 ".darkify_preset .darkify--sibling *",
111 ".button",
112 ".darkify-tooltip",
113 ".darkify-tooltip *",
114 ".rll-youtube-player .play",
115 );
116 }
117
118
119 /* =============== Elementor =============== */
120 public function getDisallowedElementsByElementor()
121 {
122 return array(
123 ".elementor-background-overlay",
124 ".elementor-element-overlay",
125 // ".elementor-button-link",
126 // ".elementor-button-link *",
127 ".elementor-widget-spacer",
128 ".elementor-widget-spacer *",
129 );
130 }
131
132
133
134 /* =============== Beaver Builder =============== */
135 public function getDisallowedElementsByBeaver()
136 {
137 return array(
138 ".uabb-button",
139 ".uabb-button *",
140 );
141 }
142
143 /* =============== Slider Revolution =============== */
144 public function getDisallowedElementsByRevSlider()
145 {
146 return array(
147 "rs-fullwidth-wrap",
148 "rs-fullwidth-wrap *",
149 );
150 }
151
152 /* =============== OneSignal Push Notifications =============== */
153 public function getDisallowedElementsByOneSignal()
154 {
155 return array(
156 ".onesignal-slidedown-dialog",
157 ".onesignal-slidedown-dialog *",
158 );
159 }
160
161 /* =============== Read Meter =============== */
162 public function getDisallowedElementsByReadMeter()
163 {
164 return array(
165 "#bsf_rt_progress_bar_container",
166 "#bsf_rt_progress_bar_container *",
167 );
168 }
169 }
170 }
171