I am growing a WordPress plugin that manipulates some Gutenberg blocks utilizing javascript.
For higher understanding, create a desk in a publish and run the code beneath within the console:
let tableHtml = doc.querySelector(".wp-block-table").innerHTML;
doc.querySelector(".wp-block-table").innerHTML = tableHtml;
I am changing the innerHTML
of a block, after which if I attempt to change the desk caption or delete the desk, it will not work.
and I feel it is as a result of the desk is modified and the eventListeners
are all gone so I must initialize them once more, however I do not understand how.
I feel I discovered the operate chargeable for that, it is table_init
situated on wp-includes/js/dist/block-library.js
however I do not know find out how to use it.
Any concepts?