Thread Starter
Giulio
(@ferocious)
I don’t like answering my own question, but I feel this is the one of the possible solutions so far, but not the best:
I used the file custom-html-widgets.js as a model for my own plugin, renaming the main method to avoid conflicts to runtime. Each plugin needs this file in order to use Codemirror into the Widgets panel and connecting it directly by using wp_enqueue_script does not seem to work. Then I worked on InitializeEditor and Init in order to find the selector for the textarea of my widget. At last I did register this new script with wp_register_script in the Widget extended class.