PluginProbe
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress / trunk
Smash Balloon Social Post Feed – Simple Social Feeds for WordPress vtrunk
4.12.0 4.10.0 4.9.0 4.8.1 trunk 1.0 1.1 1.12.1 1.2.3 1.2.4 1.2.5 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.4.0 1.4.1 1.4.2 All 171 releases
custom-facebook-feed / inc / Builder / Controls / CFF_Switcher_Control.php
CFF_Switcher_Control.php
57 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Customizer Builder
5 * Switcher Field Control
6 *
7 * @since 4.0
8 */
9
10 namespace CustomFacebookFeed\Builder\Controls;
11
12 if (!defined('ABSPATH')) {
13 exit;
14 }
15
16 class CFF_Switcher_Control extends CFF_Controls_Base
17 {
18 /**
19 * Get control type.
20 *
21 * Getting the Control Type
22 *
23 * @since 4.0
24 * @access public
25 *
26 * @return string
27 */
28 public function get_type()
29 {
30 return 'switcher';
31 }
32
33 /**
34 * Output Control
35 *
36 * @since 4.0
37 * @access public
38 *
39 * @return HTML
40 */
41 public function get_control_output($controlEditingTypeModel)
42 {
43 ?>
44 <button type="button" class="sb-control-switcher-ctn"
45 role="switch"
46 :aria-checked="(<?php echo $controlEditingTypeModel ?>[control.id] == control.options.enabled) ? 'true' : 'false'"
47 :aria-label="control.label"
48 :data-active="<?php echo $controlEditingTypeModel ?>[control.id] == control.options.enabled"
49 @click.prevent.default="changeSwitcherSettingValue(control.id, control.options.enabled, control.options.disabled, control.ajaxAction ? control.ajaxAction : false)"
50 @keydown.enter.prevent="changeSwitcherSettingValue(control.id, control.options.enabled, control.options.disabled, control.ajaxAction ? control.ajaxAction : false)"
51 @keydown.space.prevent="changeSwitcherSettingValue(control.id, control.options.enabled, control.options.disabled, control.ajaxAction ? control.ajaxAction : false)">
52 <div class="sb-control-switcher"></div>
53 <div class="sb-control-label" v-if="control.label" :data-title="control.labelStrong ? 'true' : false" aria-hidden="true">{{control.label}}</div>
54 </button>
55 <?php
56 }
57 }