How do I filter/modify the updated content on save using javascript?

You could start by adding: // What to do here? wp.data.dispatch(‘core/block-editor’).insertDefaultBlock({content:’xxxxxx’}); This will insert a block with the specified text to the end of the blocks list when the user will hit the update button. Once, and then it will self-unsubscribe. To run it every time the user hits the update button, you don’t want … Read more

Why does my JavaScript work in the browser console but does not work in my shortcode?

Solved by wrapping everything in document.addEventListener(“DOMContentLoaded”, function() {} Realized it was trying to fire the script off document.addEventListener(“DOMContentLoaded”, function () { var getSiblings = function (elem) { // Setup siblings array and get the parent var siblings = []; var sibling = elem.parentNode.parentNode; // Loop through each sibling and push to the array while (sibling) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)