Support » Plugin: Mailjet Email Marketing » Remove script frontend

  • Julie

    (@wonderfullie)


    Hi,

    Is there a way to remove the script “mailjet-front.js” in frontend ?

    I’m currently not using the plugin for newsletter subcriptions so, I don’t think I need it.

    Thanks,
    Julie.

Viewing 1 replies (of 1 total)
  • If you search in the code of the plugin with the name of this script : mailjet-front.js, you will find that it is called in the file WooCommerceSettings.php.

    Then in the function addThankYouSubscription() there are these two lines of code :

    $scriptPath = plugins_url('/src/front/js/mailjet-front.js', MAILJET_PLUGIN_DIR . 'src');
    wp_register_script('mailjet-woo-ajax-subscribe', $scriptPath, array('jquery'), false, true);

    As you can see, the plugin use wp_register_script with a given name as the first parameter.

    You can use this name to deregister the script.

    Put this line of code in your functions.php.

    wp_deregister_script('mailjet-woo-ajax-subscribe');

    The script won’t be called anymore.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove script frontend’ is closed to new replies.