PluginProbe ʕ •ᴥ•ʔ
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets / 4.2.4
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets v4.2.4
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 / devices.php
widget-options / includes / widgets / option-tabs Last commit date
alignment.php 1 month ago animation.php 1 month ago behavior.php 1 month ago days-dates.php 1 month ago devices.php 1 month ago settings.php 1 month ago state.php 1 month ago styling.php 1 month ago upsell.php 1 month ago visibility.php 1 month ago
devices.php
105 lines
1 <?php
2
3 /**
4 * Devices Visibility Widget Options
5 *
6 * @copyright Copyright (c) 2015, Jeffrey Carandang
7 * @since 1.0
8 */
9
10 // Exit if accessed directly
11 if (!defined('ABSPATH')) exit;
12
13 /**
14 * Add Alignment Widget Options Tab
15 *
16 * @since 1.0
17 * @return void
18 */
19
20 /**
21 * Called on 'extended_widget_opts_tabs'
22 * create new tab navigation for alignment options
23 */
24 function widgetopts_tab_devices($args)
25 { ?>
26 <li class="extended-widget-opts-tab-devices">
27 <a href="#extended-widget-opts-tab-<?php echo $args['id']; ?>-devices" title="<?php _e('Devices', 'widget-options'); ?>"><span class="dashicons dashicons-smartphone"></span> <span class="tabtitle"><?php _e('Devices', 'widget-options'); ?></span></a>
28 </li>
29 <?php
30 }
31 add_action('extended_widget_opts_tabs', 'widgetopts_tab_devices', 4);
32
33 /**
34 * Called on 'extended_widget_opts_tabcontent'
35 * create new tab content options for devices visibility options
36 */
37 function widgetopts_tabcontent_devices($args)
38 {
39 $desktop = '';
40 $tablet = '';
41 $mobile = '';
42 $options_role = '';
43 if (isset($args['params']) && isset($args['params']['devices'])) {
44 if (isset($args['params']['devices']['options'])) {
45 $options_role = $args['params']['devices']['options'];
46 }
47 if (isset($args['params']['devices']['desktop'])) {
48 $desktop = $args['params']['devices']['desktop'];
49 }
50 if (isset($args['params']['devices']['tablet'])) {
51 $tablet = $args['params']['devices']['tablet'];
52 }
53 if (isset($args['params']['devices']['mobile'])) {
54 $mobile = $args['params']['devices']['mobile'];
55 }
56 }
57 ?>
58 <div id="extended-widget-opts-tab-<?php echo $args['id']; ?>-devices" class="extended-widget-opts-tabcontent extended-widget-opts-tabcontent-devices">
59 <p>
60 <strong><?php _e('Hide/Show', 'widget-options'); ?></strong>
61 <select class="widefat" name="<?php echo $args['namespace']; ?>[extended_widget_opts][devices][options]">
62 <option value="hide" <?php if ($options_role == 'hide') {
63 echo 'selected="selected"';
64 } ?>><?php _e('Hide on checked devices', 'widget-options'); ?></option>
65 <option value="show" <?php if ($options_role == 'show') {
66 echo 'selected="selected"';
67 } ?>><?php _e('Show on checked devices', 'widget-options'); ?></option>
68 </select>
69 </p>
70 <table class="form-table">
71 <tbody>
72 <tr valign="top">
73 <td scope="row"><strong><?php _e('Devices', 'widget-options'); ?></strong></td>
74 <td>&nbsp;</td>
75 </tr>
76 <tr valign="top">
77 <td scope="row"><span class="dashicons dashicons-desktop"></span> <label for="extended_widget_opts-<?php echo $args['id']; ?>-devices-desktop"><?php _e('Desktop', 'widget-options'); ?></label></td>
78 <td>
79 <input type="checkbox" name="<?php echo $args['namespace']; ?>[extended_widget_opts][devices][desktop]" value="1" id="extended_widget_opts-<?php echo $args['id']; ?>-devices-desktop" <?php if (!empty($desktop)) {
80 echo 'checked="checked"';
81 } ?> />
82 </td>
83 </tr>
84 <tr valign="top">
85 <td scope="row"><span class="dashicons dashicons-tablet"></span> <label for="extended_widget_opts-<?php echo $args['id']; ?>-devices-table"><?php _e('Tablet', 'widget-options'); ?></label></td>
86 <td>
87 <input type="checkbox" name="<?php echo $args['namespace']; ?>[extended_widget_opts][devices][tablet]" value="1" id="extended_widget_opts-<?php echo $args['id']; ?>-devices-table" <?php if (!empty($tablet)) {
88 echo 'checked="checked"';
89 } ?> />
90 </td>
91 </tr>
92 <tr valign="top">
93 <td scope="row"><span class="dashicons dashicons-smartphone"></span> <label for="extended_widget_opts-<?php echo $args['id']; ?>-devices-mobile"><?php _e('Mobile', 'widget-options'); ?></label></td>
94 <td>
95 <input type="checkbox" name="<?php echo $args['namespace']; ?>[extended_widget_opts][devices][mobile]" value="1" id="extended_widget_opts-<?php echo $args['id']; ?>-devices-mobile" <?php if (!empty($mobile)) {
96 echo 'checked="checked"';
97 } ?> />
98 </td>
99 </tr>
100 </tbody>
101 </table>
102 </div>
103 <?php
104 }
105 add_action('extended_widget_opts_tabcontent', 'widgetopts_tabcontent_devices'); ?>