| Server IP : 146.59.209.152 / Your IP : 216.73.216.46 Web Server : Apache System : Linux webm005.cluster131.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : infrafs ( 43850) PHP Version : 8.2.29 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/infrafs/bike/wp-content/themes/colibri-wp/inc/src/Customizer/Controls/ |
Upload File : |
<?php
namespace ColibriWP\Theme\Customizer\Controls;
class SwitchControl extends VueControl {
public $type = 'colibri-switch';
protected $active_color = "#008ec2";
protected $inactive_color = "#949596";
protected $inline_content_template = true;
public function json() {
return array_merge( parent::json(), $this->getProps( array( 'active_color', 'inactive_color' ) ) );
}
protected function printVueContent() {
?>
<el-switch
v-model="value"
active-color="{{ data.active_color }}"
inactive-color="{{ data.inactive_color }}"
@change="setValue"
>
</el-switch>
<?php
}
public static function sanitize( $value, $control_data, $default = '' ) {
if ( $value === true || $value === '1' || $value === 1 ) {
return true;
}
return false;
}
}