PluginProbe ʕ •ᴥ•ʔ
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets / 3.9.6
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets v3.9.6
4.2.5 4.2.4 trunk 3.7.10 3.7.11 3.7.12 3.7.13 3.7.14 3.7.2 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8 3.8.1 3.8.10 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 3.8.9 3.8.9.1 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.5.1 4.0.6 4.0.6.1 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.2 4.1.3 4.2.0 4.2.1 4.2.2 4.2.3
widget-options / includes / widgets / option-tabs / settings.php
widget-options / includes / widgets / option-tabs Last commit date
alignment.php 2 years ago days-dates.php 4 years ago devices.php 2 years ago settings.php 2 years ago state.php 2 years ago styling.php 4 years ago upsell.php 2 years ago visibility.php 2 years ago
settings.php
339 lines
1 <?php
2 /**
3 * Settings Widget Options
4 *
5 * @copyright Copyright (c) 2015, Jeffrey Carandang
6 * @since 1.0
7 */
8
9 // Exit if accessed directly
10 if ( ! defined( 'ABSPATH' ) ) exit;
11
12 /**
13 * Add Settings Widget Options Tab
14 *
15 * @since 1.0
16 * @return void
17 */
18
19 /**
20 * Called on 'extended_widget_opts_tabs'
21 * create new tab navigation for alignment options
22 */
23 if( !function_exists( 'widgetopts_tab_settings' ) ):
24 function widgetopts_tab_settings( $args ){ ?>
25 <li class="extended-widget-opts-tab-class">
26 <a href="#extended-widget-opts-tab-<?php echo $args['id'];?>-class" title="<?php _e( 'Class,ID & Logic', 'widget-options' );?>" ><span class="dashicons dashicons-admin-generic"></span> <span class="tabtitle"><?php _e( 'Other Settings', 'widget-options' );?></span></a>
27 </li>
28 <?php
29 }
30 add_action( 'extended_widget_opts_tabs', 'widgetopts_tab_settings' );
31 endif;
32
33 /**
34 * Called on 'extended_widget_opts_tabcontent'
35 * create new tab content options for alignment options
36 */
37 if( !function_exists( 'widgetopts_tabcontent_settings' ) ):
38 function widgetopts_tabcontent_settings( $args ){
39 global $widget_options;
40
41 $id = '';
42 $classes = '';
43 $logic = '';
44 $selected = 0;
45 $check = '';
46 if( isset( $args['params'] ) && isset( $args['params']['class'] ) ){
47 if( isset( $args['params']['class']['id'] ) ){
48 $id = $args['params']['class']['id'];
49 }
50 if( isset( $args['params']['class']['classes'] ) ){
51 $classes = $args['params']['class']['classes'];
52 }
53 if( isset( $args['params']['class']['selected'] ) ){
54 $selected = $args['params']['class']['selected'];
55 }
56 if( isset( $args['params']['class']['logic'] ) ){
57 $logic = $args['params']['class']['logic'];
58 }
59 if( isset( $args['params']['class']['title'] ) && $args['params']['class']['title'] == '1' ){
60 $check = 'checked="checked"';
61 }
62 }
63
64 $predefined = array();
65 if( isset( $widget_options['settings']['classes'] ) && isset( $widget_options['settings']['classes']['classlists'] ) && !empty( $widget_options['settings']['classes']['classlists'] ) ){
66 $predefined = $widget_options['settings']['classes']['classlists'];
67 }
68 ?>
69 <div id="extended-widget-opts-tab-<?php echo $args['id'];?>-class" class="extended-widget-opts-tabcontent extended-widget-opts-inside-tabcontent extended-widget-opts-tabcontent-class">
70
71 <div class="extended-widget-opts-settings-tabs extended-widget-opts-inside-tabs">
72 <input type="hidden" id="extended-widget-opts-settings-selectedtab" value="<?php echo $selected;?>" name="<?php echo $args['namespace'];?>[extended_widget_opts][class][selected]" />
73 <!-- start tab nav -->
74 <ul class="extended-widget-opts-settings-tabnav-ul">
75 <?php if( 'activate' == $widget_options['hide_title'] ){ ?>
76 <li class="extended-widget-opts-settings-tab-title">
77 <a href="#extended-widget-opts-settings-tab-<?php echo $args['id'];?>-title" title="<?php _e( 'Misc', 'widget-options' );?>" ><?php _e( 'Misc', 'widget-options' );?></a>
78 </li>
79 <?php } ?>
80
81 <?php if( 'activate' == $widget_options['classes'] ){ ?>
82 <li class="extended-widget-opts-settings-tab-class">
83 <a href="#extended-widget-opts-settings-tab-<?php echo $args['id'];?>-class" title="<?php _e( 'Class & ID', 'widget-options' );?>" ><?php _e( 'Class & ID', 'widget-options' );?></a>
84 </li>
85 <?php } ?>
86
87 <li class="extended-widget-opts-settings-tab-animation">
88 <a href="#extended-widget-opts-settings-tab-<?php echo $args['id'];?>-animation" title="<?php _e( 'Animation', 'widget-options' );?>" ><?php _e( 'Animation', 'widget-options' );?></a>
89 </li>
90
91 <?php if( 'activate' == $widget_options['logic'] ){ ?>
92 <li class="extended-widget-opts-settings-tab-logic">
93 <a href="#extended-widget-opts-settings-tab-<?php echo $args['id'];?>-logic" title="<?php _e( 'Display Logic', 'widget-options' );?>" ><?php _e( 'Logic', 'widget-options' );?></a>
94 </li>
95 <?php } ?>
96 <div class="extended-widget-opts-clearfix"></div>
97 </ul><!-- end tab nav -->
98 <div class="extended-widget-opts-clearfix"></div>
99
100 <?php if( 'activate' == $widget_options['hide_title'] ){ ?>
101 <!-- start title tab content -->
102 <div id="extended-widget-opts-settings-tab-<?php echo $args['id'];?>-title" class="extended-widget-opts-settings-tabcontent extended-widget-opts-inner-tabcontent">
103 <div class="widget-opts-title">
104 <?php if( 'activate' == $widget_options['hide_title'] ){ ?>
105 <p class="widgetopts-subtitle"><?php _e( 'Hide Widget Title', 'widget-options' );?></p>
106 <p>
107 <input type="checkbox" name="<?php echo $args['namespace'];?>[extended_widget_opts][class][title]" id="opts-class-title-<?php echo $args['id'];?>" value="1" <?php echo $check;?> />
108 <label for="opts-class-title-<?php echo $args['id'];?>"><?php _e( 'Check to hide widget title', 'widget-options' );?></label>
109 </p>
110 <?php } ?>
111 </div>
112 </div><!-- end title tab content -->
113 <?php } ?>
114
115 <?php if( 'activate' == $widget_options['classes'] ){ ?>
116 <!-- start class tab content -->
117 <div id="extended-widget-opts-settings-tab-<?php echo $args['id'];?>-class" class="extended-widget-opts-settings-tabcontent extended-widget-opts-inner-tabcontent">
118 <div class="widget-opts-class">
119 <table class="form-table">
120 <tbody>
121 <?php if( isset( $widget_options['settings']['classes'] ) && ( isset( $widget_options['settings']['classes']['id'] ) && '1' == $widget_options['settings']['classes']['id'] ) ){?>
122 <tr valign="top" class="widgetopts_id_fld">
123 <td scope="row">
124 <strong><?php _e( 'Widget CSS ID:', 'widget-options' );?></strong><br />
125 <input type="text" id="opts-class-id-<?php echo $args['id'];?>" class="widefat" name="<?php echo $args['namespace'];?>[extended_widget_opts][class][id]" value="<?php echo $id;?>" />
126 </td>
127 </tr>
128 <?php } ?>
129
130 <?php if( !isset( $widget_options['settings']['classes'] ) ||
131 ( isset( $widget_options['settings']['classes'] ) && isset( $widget_options['settings']['classes']['type'] ) && !in_array( $widget_options['settings']['classes']['type'] , array( 'hide', 'predefined' ) ) ) ){?>
132 <tr valign="top">
133 <td scope="row">
134 <strong><?php _e( 'Widget CSS Classes:', 'widget-options' );?></strong><br />
135 <input type="text" id="opts-class-classes-<?php echo $args['id'];?>" class="widefat" name="<?php echo $args['namespace'];?>[extended_widget_opts][class][classes]" value="<?php echo $classes;?>" />
136 <small><em><?php _e( 'Separate each class with space.', 'widget-options' );?></em></small>
137 </td>
138 </tr>
139 <?php } ?>
140 <?php if( !isset( $widget_options['settings']['classes'] ) ||
141 ( isset( $widget_options['settings']['classes'] ) && isset( $widget_options['settings']['classes']['type'] ) && !in_array( $widget_options['settings']['classes']['type'] , array( 'hide', 'text' ) ) ) ){?>
142 <?php if( is_array( $predefined ) && !empty( $predefined ) ){
143 $predefined = array_unique( $predefined ); //remove dups
144 ?>
145 <tr valign="top">
146 <td scope="row">
147 <strong><?php _e( 'Available Widget Classes:', 'widget-options' );?></strong><br />
148 <div class="extended-widget-opts-class-lists" style="max-height: 230px;padding: 5px;overflow:auto;">
149 <?php foreach ($predefined as $key => $value) {
150 if( isset( $args['params']['class']['predefined'] ) &&
151 is_array( $args['params']['class']['predefined'] ) &&
152 in_array( $value , $args['params']['class']['predefined'] ) ){
153 $checked = 'checked="checked"';
154 }else{
155 $checked = '';
156 }
157 ?>
158 <p>
159 <input type="checkbox" name="<?php echo $args['namespace'];?>[extended_widget_opts][class][predefined][]" id="<?php echo $args['id'];?>-opts-class-<?php echo $key;?>" value="<?php echo $value;?>" <?php echo $checked;?> />
160 <label for="<?php echo $args['id'];?>-opts-class-<?php echo $key;?>"><?php echo $value;?></label>
161 </p>
162 <?php } ?>
163 </div>
164 </td>
165 </tr>
166 <?php } ?>
167 <?php } ?>
168 </tbody>
169 </table>
170 </div>
171 </div><!-- end class tab content -->
172 <?php } ?>
173
174 <!-- start Animation tab demo -->
175 <?php
176 $animation_array = array(
177 'Attention Seekers' => array(
178 'bounce',
179 'flash',
180 'pulse',
181 'rubberBand',
182 'shake',
183 'swing',
184 'tada',
185 'wobble',
186 'jello'
187 ) ,
188 'Bouncing Entrances' => array(
189 'bounceIn',
190 'bounceInDown',
191 'bounceInLeft',
192 'bounceInRight',
193 'bounceInUp',
194 ),
195
196 'Fading Entrances' => array(
197 'fadeIn',
198 'fadeInDown',
199 'fadeInDownBig',
200 'fadeInLeft',
201 'fadeInLeftBig',
202 'fadeInRight',
203 'fadeInRightBig',
204 'fadeInUp',
205 'fadeInUpBig'
206 ),
207 'Flippers' => array(
208 'flip',
209 'flipInX',
210 'flipInY',
211 'flipOutX',
212 'flipOutY'
213 ),
214 'Lightspeed' => array(
215 'lightSpeedIn',
216 'lightSpeedOut'
217 ),
218
219 'Rotating Entrances' => array(
220 'rotateIn',
221 'rotateInDownLeft',
222 'rotateInDownRight',
223 'rotateInUpLeft',
224 'rotateInUpRight'
225 ),
226 'Sliding Entrances' => array(
227 'slideInUp',
228 'slideInDown',
229 'slideInLeft',
230 'slideInRight'
231 ),
232 'Zoom Entrances' => array(
233 'zoomIn',
234 'zoomInDown',
235 'zoomInLeft',
236 'zoomInRight',
237 'zoomInUp'
238 ),
239 'Specials' => array(
240 'hinge',
241 'rollIn'
242 )
243 ); ?>
244 <!-- start animation tab content -->
245 <div id="extended-widget-opts-settings-tab-<?php echo $args['id'];?>-animation" class="extended-widget-opts-settings-tabcontent extended-widget-opts-inner-tabcontent">
246 <div class="widget-opts-animation">
247 <div class="extended-widget-opts-demo-feature">
248 <div class="extended-widget-opts-demo-warning">
249 <p class="widgetopts-unlock-features">
250 <span class="dashicons dashicons-lock"></span><br>
251 Unlock all Features<br>
252 <a href="https://widget-options.com/?utm_source=wordpressadmin&amp;utm_medium=widgettabs&amp;utm_campaign=widgetoptsprotab" class="button-primary" target="_blank">Learn More</a>
253 </p>
254 </div>
255 <p>
256 <label for="opts-class-animation-<?php echo $args['id'];?>"><?php _e( 'Animation Type', 'widget-options' );?></label>
257 <br />
258 <select class="widefat" readonly>
259 <option value=""><?php _e( 'None', 'widget-options' );?></option>
260 <?php foreach( $animation_array as $group => $anims ){ ?>
261 <optgroup label="<?php _e( $group, 'widget-options' );?>">
262 <?php foreach( $anims as $anim => $aname ){ ?>
263 <option value="<?php echo $aname;?>"><?php _e( $aname, 'widget-options' )?></option>
264 <?php } ?>
265 </optgroup>
266 <?php } ?>
267 </select>
268 <small><em><?php _e( 'The type of animation for this event.', 'widget-options' );?></em></small>
269 </p>
270
271 <p>
272 <label for="opts-class-event-<?php echo $args['id'];?>"><?php _e( 'Animation Event', 'widget-options' );?></label>
273 <br />
274 <select class="widefat" readonly>
275 <option value="enters"><?php _e( 'Element Enters Screen', 'widget-options' );?></option>
276 <option value="onScreen"><?php _e( 'Element In Screen', 'widget-options' );?></option>
277 <option value="pageLoad"><?php _e( 'Page Load', 'widget-options' );?></option>
278 </select>
279 <small><em><?php _e( 'The event that triggers the animation', 'widget-options' );?></em></small>
280 </p>
281
282 <p>
283 <label for="opts-class-speed-<?php echo $args['id'];?>"><?php _e( 'Animation Speed', 'widget-options' );?></label>
284 <br />
285 <input type="text" class="widefat" readonly />
286 <small><em><?php _e( 'How many seconds the incoming animation should lasts.', 'widget-options' );?></em></small>
287 </p>
288
289 <p>
290 <label for="opts-class-offset-<?php echo $args['id'];?>"><?php _e( 'Screen Offset', 'widget-options' );?></label>
291 <br />
292 <input type="text" readonly />
293 <small><em><?php _e( 'How many pixels above the bottom of the screen must the widget be before animating.', 'widget-options' );?></em></small>
294 </p>
295
296 <p>
297 <label for="opts-class-hidden-<?php echo $args['id'];?>"><?php _e( 'Hide Before Animation', 'widget-options' );?></label>
298 <br />
299 <input type="checkbox" value="1" readonly />
300 <label for="opts-class-hidden-<?php echo $args['id'];?>"><?php _e( 'Enabled', 'widget-options' );?></label><br />
301 <small><em><?php _e( 'Hide widget before animating.', 'widget-options' );?></em></small>
302 </p>
303
304 <p>
305 <label for="opts-class-delay-<?php echo $args['id'];?>"><?php _e( 'Animation Delay', 'widget-options' );?></label>
306 <br />
307 <input type="text" class="widefat" readonly />
308 <small><em><?php _e( 'Number of seconds after the event to start the animation.', 'widget-options' );?></em></small>
309 </p>
310 </div>
311 </div>
312 </div><!-- end animation tab content -->
313 <!-- end Animation tab demo -->
314
315 <?php if( 'activate' == $widget_options['logic'] ){ ?>
316 <!-- start logic tab content -->
317 <div id="extended-widget-opts-settings-tab-<?php echo $args['id'];?>-logic" class="extended-widget-opts-settings-tabcontent extended-widget-opts-inner-tabcontent">
318 <div class="widget-opts-logic">
319 <p><small><?php _e( 'The text field lets you use <a href="http://codex.wordpress.org/Conditional_Tags" target="_blank">WP Conditional Tags</a>, or any general PHP code.', 'widget-options' );?></small></p>
320 <textarea class="widefat" name="<?php echo $args['namespace'];?>[extended_widget_opts][class][logic]"><?php echo stripslashes( $logic );?></textarea>
321
322 <?php if( !isset( $widget_options['settings']['logic'] ) ||
323 ( isset( $widget_options['settings']['logic'] ) && !isset( $widget_options['settings']['logic']['notice'] ) ) ){ ?>
324 <p><a href="#" class="widget-opts-toggler-note"><?php _e( 'Click to Toggle Note', 'widget-options' );?></a></p>
325 <p class="widget-opts-toggle-note"><small><?php _e( 'PLEASE NOTE that the display logic you introduce is EVAL\'d directly. Anyone who has access to edit widget appearance will have the right to add any code, including malicious and possibly destructive functions. There is an optional filter <em>"widget_options_logic_override"</em> which you can use to bypass the EVAL with your own code if needed.', 'widget-options' );?></small></p>
326 <?php } ?>
327 </div>
328 </div><!-- end logiv tab content -->
329 <?php } ?>
330
331 </div><!-- end .extended-widget-opts-settings-tabs -->
332
333
334 </div>
335 <?php
336 }
337 add_action( 'extended_widget_opts_tabcontent', 'widgetopts_tabcontent_settings');
338 endif; ?>
339