jQuery(document).ready(function($) { //"use strict"; //Switch Control $('body').on('click', '.onoffswitch', function(){ var $this = $(this); if($this.hasClass('switch-on')){ $(this).removeClass('switch-on'); $this.next('input').val('off').trigger('change') }else{ $(this).addClass('switch-on'); $this.next('input').val('on').trigger('change') } }); //MultiCheck box Control JS $( '.customize-control-checkbox-multiple input[type="checkbox"]' ).on( 'change', function() { var checkbox_values = $( this ).parents( '.customize-control' ).find( 'input[type="checkbox"]:checked' ).map( function() { return $( this ).val(); } ).get().join( ',' ); $( this ).parents( '.customize-control' ).find( 'input[type="hidden"]' ).val( checkbox_values ).trigger( 'change' ); } ); }); // Extends our custom section. ( function( api ) { api.sectionConstructor['pro-section'] = api.Section.extend( { // No events for this type of section. attachEvents: function () {}, // Always make the section active. isContextuallyActive: function () { return true; } } ); } )( wp.customize );