1

I write a basic plugin with custom css/js. I use wp_enqueue_script for my custom script and use hook 'init' to register script in front-end page. But wordpress load this javascript file two times with different version. ( See in image ) And I don't know why. I load this script one time and load it in one point of my code.

I have tried clean cache wordpress, cache browser, but nothing do. custom-addon.js?ver=5.9 and custom-addon.js

My site is esposte online : https://node.alfonsosomma.it/2022/02/04/articolo-prova/ I write plugin to use add_shortcode function to create form; shortcode for the form in this page (articolo-prova).

Best regards,

3
  • On your site's source code I can see two places where custom-addons.js is enqueued one in head and one in footer. Best thing you can do is search for "custom-addons.js" in your code base and see where it is being enqueued.
    – SD433
    CommentedFeb 10, 2022 at 18:40
  • 3
    based on the script tags there is a script tag with the ID custom-addons-js-js and another with custom-addons-js, it's likely that you've made a mistake somewhere and registered it twice with slightly different handles, aka custom-addons and custom-addons-js. Where you've done this however is unclear as we don't have access to your code. Also there is no code for the shortcode you mentioned and you haven't shared the name of the plugin you used
    – Tom J Nowell
    CommentedFeb 10, 2022 at 18:46
  • Ty for response, I find another hook custom-addons in my plugin and it's problem. Thank you so much for support
    – tecnico57
    CommentedFeb 10, 2022 at 20:36

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.