• Resolved Matt Pramschufer

    (@mattpramschufer)


    Hey there,

    We are running into a conflict with other plugins because of the Select2 library. I see that no matter what ProfilePress includes the JS on every page even though its not being used 99% of the time. Is there a way to get an option in the upcoming version to dequeue scripts on frontend when not in use?

    You somewhat do that now, but only for your frontend.js file. You load

        wp_enqueue_script('ppress-flatpickr', PPRESS_ASSETS_URL . '/flatpickr/flatpickr.min.js', array('jquery'), PPRESS_VERSION_NUMBER);
    
        wp_enqueue_script('ppress-select2', PPRESS_ASSETS_URL . '/select2/select2.min.js', array('jquery'), PPRESS_VERSION_NUMBER);

    no matter what

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Do not load javascript when not needed’ is closed to new replies.