• Hi everybody!

    I’m trying to create a custom block and I have the following problem:

    I have my custom container block that gets custom rich text blocks (these child blocks add a css animation to the rich-text core block). The point of the container it’s to manage the display of each of its children one-by-one. In order to do so, I’ve developed a small js script that handle all the different instances of my custom container block and I enqueue it in the front. To this point everything its working properly.

    Now, since WP embraces the WYSIWYG paradigm, I wanted to add the same behavior in the editor view. My first attempt was to enqueue the script in ‘enqueue_block_editor_assets’ but since the visual editor uses an inline generated iframe my script can’t access the inner document elements.

    So the question is, how and where should I add this js script to make it work? Should I approach this differently?

  • The topic ‘How to include custom JS inside TinyMCE’ is closed to new replies.