elegantthemes / create-divi-extension

MIT License
186 stars 59 forks source link

Frontend JS running in Backend #451

Open holmesadrianh opened 3 years ago

holmesadrianh commented 3 years ago

I have some js running in frontend.js which seems to run in the wordpress backend when editing the page using the divi builder. This is not even the visual builder via the frontend, this is the backend.

Is there a way to only run JS in the front end?

Just so you know that I have tested this, I have added an alert in frontend.js: alert('frontend.js loaded');

This line is nowhere else. And when I edit the page in the backend, I see the alert. I do not want any JS to be running when editing the page via the backend. Is there a way to check if its the front end?

holmesadrianh commented 3 years ago

I also notice that the scripts that are being loaded via 'wp_enqueue_scripts' are loading in the backend as well. Is this normal?