Support » Plugin: Pronamic Google Maps » Modify plugin properly site.js

  • Resolved jcuenin


    Hi everyone,

    i would like to find a way to modify the plugin and most precisely the site.js file.

    I could change directly the site.js file but then at every update i will have to modify the code again.

    So is there a way for me to unregister the base site.js and load m custom one instead and that the plugin can be updated without troubles?

    I saw i can use hooks and such but i am not so much confident with that.

    Thanks in advance,


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Remco Tolsma


    I think this is possible, we register the script in the following file:

    Maybe you can deregister this script and register your own script.

    Thank you for your answer, yes i did try this, my script was loading but i got that error in the console : Uncaught ReferenceError: google is not defined.

    I just copied the old script and did my modifications.

    When i did my modifications inside site.js it was working though.

    Alright it’s working my bad!

    I forgot to add array(‘jquery’, ‘google-jsapi’) when i was registering my plugin.

    So basicly what i did was :

    Create a new plugin named my google maps and a modified site.js to deregister the base script and then register mine.

    add_action( ‘wp_print_scripts’, ‘my_deregister_javascript’, 100 );

    function my_deregister_javascript() {
    wp_deregister_script( ‘pronamic-google-maps-site’ );
    ‘pronamic-google-maps-site’ ,
    plugins_url(‘my-google-maps/site.js’) ,
    array(‘jquery’, ‘google-jsapi’)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modify plugin properly site.js’ is closed to new replies.