0

I am trying to create a javascript which fires everytime the preview iframe is refreshed. I have found this one:

wp.customize.bind('ready', function () {

});

But this only works when the Customizer is first loaded. I use transport postMessage on my custom settings, and this only refreshes the iframe. How do I hook into this to know when the iframe has been refreshed?

Thank you!

  • wp.customize.previewer.bind( 'refresh', function() { wp.customize.previewer.refresh(); } ); – vikrant zilpe Dec 4 '18 at 12:56
  • please check link : make.xwp.co/2015/12/08/… – vikrant zilpe Dec 4 '18 at 12:59
  • @vikrantzilpe I already use postMessage and selective refresh, that part works great. But I have a jQuery function that fires when an input is selected in the Customizer. Problem is that after I have entered something to the input and the content is selectivly refreshed it will not rerun this jQuery function. – joq3 Dec 4 '18 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.