How can I stop the refresh
event for the Customizer iframe? Something like:
wp.customize.refresh( function() {
return; // or whatever would stop the refresh
} );
The background: I'm using Kirki to add a code editor field to the front end Customizer. It gets an option from my theme option's custom CSS area (not a theme I developed, so I cannot use traditional theme_mod) and I can properly get/put the data from this option to write custom CSS from the front end Customizer.
For the live edit to work, I modified the front end custom CSS <style>
element to have a unique ID, and using CodeMirror's update
event I can replace the <style>
element's contents successfully and see the live changes. However, the Customizer refresh
event also fires just moments after, thus wiping out the updated <style>
element.