You can use the
transport argument to define how your options will be applied to the preview.
There are 3 choices available:
postMessage docs too
This argument uses the
postMessage module. Please make sure you read the documentation for the postMessage module
By default all fields use the
refresh method. This will force-refresh the preview pane in the customizer when the value changes.
If your field already contains an
output argument you can set
auto. This will allow Kirki to auto-generate the
js_vars argument according to your
output and make the field work seamlessly both in the frontend and in the customizer without any code duplication.
If you use the
If you decide to write your own scripts - which is highly advisable - we advise you to first read this post on developer.wordpress.org as well as this blog post on Otto’s blog.