/** * Canuck WordPress Theme Multiple Category * * Multiple category checkbox selector. * * @link http://kevinsspace.ca * @license Copyright (C) 2017-2019 kevinhaig Licensed GPLv2 or later * @package Canuck WordPress Theme * @link http://justintadlock.com/archives/2015/05/26/multiple-checkbox-customizer-control/ */ jQuery(window).on("load",function() { /* === Checkbox Multiple Control === */ jQuery( document ).on('change', '.customize-control-mcat input[type="checkbox"]', function() { checkbox_values = jQuery( this ).parents( '.customize-control' ).find( 'input[type="checkbox"]:checked' ).map( function() { return this.value; } ).get().join( ',' ); //alert(checkbox_values); jQuery( this ).parents( '.customize-control' ).find( 'input[type="hidden"]' ).val( checkbox_values ).trigger( 'change' ); }); }); // jQuery( document ).ready