PluginProbe ʕ •ᴥ•ʔ
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets / 3.7.13
Widget Options – Advanced Conditional Visibility for Gutenberg Blocks & Classic Widgets v3.7.13
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 4 years ago devices.php 4 years ago settings.php 4 years ago state.php 4 years ago upsell.php 4 years ago visibility.php 4 years ago
devices.php
93 lines
1 <?php
2 /**
3 * Devices Visibility 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 Alignment 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 function widgetopts_tab_devices( $args ){ ?>
24 <li class="extended-widget-opts-tab-devices">
25 <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>
26 </li>
27 <?php
28 }
29 add_action( 'extended_widget_opts_tabs', 'widgetopts_tab_devices' );
30
31 /**
32 * Called on 'extended_widget_opts_tabcontent'
33 * create new tab content options for devices visibility options
34 */
35 function widgetopts_tabcontent_devices( $args ){
36 $desktop = '';
37 $tablet = '';
38 $mobile = '';
39 $options_role = '';
40 if( isset( $args['params'] ) && isset( $args['params']['devices'] ) ){
41 if( isset( $args['params']['devices']['options'] ) ){
42 $options_role = $args['params']['devices']['options'];
43 }
44 if( isset( $args['params']['devices']['desktop'] ) ){
45 $desktop = $args['params']['devices']['desktop'];
46 }
47 if( isset( $args['params']['devices']['tablet'] ) ){
48 $tablet = $args['params']['devices']['tablet'];
49 }
50 if( isset( $args['params']['devices']['mobile'] ) ){
51 $mobile = $args['params']['devices']['mobile'];
52 }
53 }
54 ?>
55 <div id="extended-widget-opts-tab-<?php echo $args['id'];?>-devices" class="extended-widget-opts-tabcontent extended-widget-opts-tabcontent-devices">
56 <p>
57 <strong><?php _e( 'Hide/Show', 'widget-options' );?></strong>
58 <select class="widefat" name="<?php echo $args['namespace'];?>[extended_widget_opts][devices][options]">
59 <option value="hide" <?php if( $options_role == 'hide' ){ echo 'selected="selected"'; }?> ><?php _e( 'Hide on checked devices', 'widget-options' );?></option>
60 <option value="show" <?php if( $options_role == 'show' ){ echo 'selected="selected"'; }?>><?php _e( 'Show on checked devices', 'widget-options' );?></option>
61 </select>
62 </p>
63 <table class="form-table">
64 <tbody>
65 <tr valign="top">
66 <td scope="row"><strong><?php _e( 'Devices', 'widget-options' );?></strong></td>
67 <td>&nbsp;</td>
68 </tr>
69 <tr valign="top">
70 <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>
71 <td>
72 <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 ) ){ echo 'checked="checked"'; }?> />
73 </td>
74 </tr>
75 <tr valign="top">
76 <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>
77 <td>
78 <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 ) ){ echo 'checked="checked"'; }?> />
79 </td>
80 </tr>
81 <tr valign="top">
82 <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>
83 <td>
84 <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 ) ){ echo 'checked="checked"'; }?> />
85 </td>
86 </tr>
87 </tbody>
88 </table>
89 </div>
90 <?php
91 }
92 add_action( 'extended_widget_opts_tabcontent', 'widgetopts_tabcontent_devices'); ?>
93