• Resolved newharvest

    (@newharvest)


    Like @dyuen888, I was running into this same problem: Slider conflict with ACF time picker

    I figured out a fix, so I thought I’d post it:

    I added this code to my custom theme’s functions.php file, so it won’t be overwritten when Crelly Slider updates.

    /**
     * Crelly Slider's 'datetimepicker' script conflicts 
     * with and overrides the ACF one and causes issues.
     * In order to remove it, we have to also dequeue/
     * deregister 'crellyslider-admin' and re-add it 
     * without the 'datetimepicker' dependency.
     */
    function my_remove_crelly_datepicker() {
      $screen = get_current_screen();
      // Do not do this on CrellySlider admin pages, so they'll still work.
      if ( $screen->base !== 'toplevel_page_crellyslider' ) {
        wp_dequeue_script('crellyslider-admin');
        wp_deregister_script('crellyslider-admin');
        wp_dequeue_script('datetimepicker');
        wp_register_script('crellyslider-admin', CS_PLUGIN_URL.'/wordpress/js/admin.js', array('wp-color-picker'), CS_VERSION, true);
        wp_enqueue_script('crellyslider-admin');
      }
    }
    add_action( 'admin_enqueue_scripts', 'my_remove_crelly_datepicker', 100 );
    • This topic was modified 2 years, 7 months ago by newharvest. Reason: code formatting
    • This topic was modified 2 years, 7 months ago by James Huff.
  • The topic ‘Slider conflict with ACF time picker – Solution’ is closed to new replies.