checkbox.js (497B)
1 wp.customize.controlConstructor['kirki-checkbox'] = wp.customize.Control.extend({ 2 3 // When we're finished loading continue processing 4 ready: function() { 5 6 'use strict'; 7 8 var control = this, 9 value = control.setting._value; 10 11 // Change the value 12 this.container.on( 'change', 'input', function() { 13 14 // Get the checkbox status 15 value = ( jQuery( this ).is( ':checked' ) ) ? true : false; 16 17 // Set the value in the WordPress API 18 control.setting.set( value ); 19 20 }); 21 22 } 23 24 });