0

I'm building a plugin that does some transformations on front page through JS script.

I'm trying to build a contextual control in the customizer so that when a certain section is opened I modify the view in iframe_

what's the correct listener (and hook) for the section menu-toogle "open" event ?

1 Answer 1

0

So far the only solution I've come up with is creating a function that postMessages the event into the iframe (using customize_controls_enqueue_scripts hook).

As for the receiver in iframe (hooked on customize_preview_init hook) I think it could still need some optimization because I'm getting a weird issue with window.addEventListener('message',* getting some duplicate on customizer loading..

But probably it's the way it's supposed to work since i'm using the customize_preview_init hook twice.

Since I feel their might be better ways any feedback or comment is welcome_

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.