Support » Plugin: Email Encoder - Protect Email Addresses » Add option to enqueue custom.js in footer

  • Resolved Patrick Whitty-Clarke

    (@zerodegreeburn)


    Hi,

    I enqueue my theme scripts in the footer and custom.js is set to load in the header, before my jQuery kicks in. It would be nice if this plugin gave an option to enqueue the JS in the footer or header. For now I’ve had to use this code, maybe it’ll help someone else:

    add_filter( ‘wp_enqueue_scripts’, ‘preface_enqueue_email_encoder_script’, 1 );

    function preface_enqueue_email_encoder_script() {
    wp_dequeue_script( ‘eeb-js-frontend’ );
    wp_enqueue_script( ‘eeb-js-frontend’, WP_PLUGIN_URL . ‘/email-encoder-bundle/core/includes/assets/js/custom.js’, array( ‘jquery’ ), ”, true );
    }

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

    (@ironikus)

    HEy @zerodegreeburn – thanks a lot for your message and the detailed help, we really appreciate that!
    I have also good news for you: We added this feature to our new, upcoming version. After release, you will find a settings option to set the scripts within the footer.

    Please let me know in case you have any further questions. 🙂

    Plugin Author Ironikus

    (@ironikus)

    Hey @zerodegreeburn – We just pushed a new version. You will now find a settings item to set the scripts to the footer.
    In case you have any other questions, feel free to reach out.

    Hi @ironikus , thanks for including this option. I’ll update my theme soon.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add option to enqueue custom.js in footer’ is closed to new replies.