This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( $ ) { | |
$( window ).load( function() { | |
// When 'Use Portal Color Controls' customizer control is toggled | |
wp.customize( 'portal_color_control', function ( value ) { | |
value.bind( function( newval ) { | |
// If toggled off, warn user that portal color settings will be deleted | |
if ( 'off' == newval ) { | |
var confirmation = window.confirm( "WARNING: turning this off will delete all the portal color settings. Continue?" ); | |
if ( true == confirmation ) { | |
// If user confirms, run code here to delete all portal color settings | |
} else { | |
// If user does not confirm, reset the customizer control to 'on' | |
this.set( 'on' ); | |
} | |
} | |
}); | |
}); | |
}); | |
})( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment