Since version 2.6.1 we've deprecated the custom JavaScript editor in favour of our advanced JavaScript API. The Buttonizer JavaScript API is available since Buttonizer version 2.2 which was released on November 7, 2020.
What does this mean?
This mean you will need to migrate your current JavaScript button action in a few steps.
Even with little JavaScript experience, you should be able to execute these steps below. If you need assistance anyway, please make sure to ask your webmaster.
What do I need to do?
Follow the steps below for all buttons that are using the Custom JavaScript
action:
- Install a Headers & Footers plugin for WordPress (or if you have one already installed, use that one)
- Paste the code that appears to your footer, make sure
<script>
tags are applied.
<script type="text/javascript">
window.addEventListener("buttonizer_button_clicked", event => {
if(event.detail.button_id === "YOUR-BUTTON-ID-HERE") {
console.log("Clicked button - Perform your action here");
}
});
</script>
- Open the Buttonizer JavaScript editor
- Copy all code
- Paste the code in the headers footers and replace
console.log("Clicked button - Perform your action here");
- Save the changes on the headers-footers plugin
- Click the
Click here to remove the deprecated code.
code
- Click the 'Publish' button
Repeat this process for all buttons that use the Buttonizer JavaScript editor.
Note: In a future version we will remove the JavaScript editor from the source to minimalize the bundle size of our editor.