0

I upgraded a version of Chauffeur plugin from 6.4 to 9.0. This is form plugin and on form there are date and time options. So when I select time after selecting date. Console shows this error. I changed theme, disabled some unwanted plugins, try to load Jquery early using some php snippet with WP code plugin. But nothing works. What is this error and how it can be solved in Wordpress.

jquery.timepicker.min.js:1362 Uncaught TypeError: 
Cannot read properties of undefined (reading 'find')
at _selectValue (jquery.timepicker.min.js:1362:25)
at HTMLLIElement.<anonymous> (jquery.timepicker.min.js:952:15)
at HTMLUListElement.dispatch (jquery.min.js?ver=3.7.1:2:40035)
at HTMLUListElement.<anonymous> (jquery.min.js?ver=3.7.1:2:38006)

1 Answer 1

-1
function my_enqueue_timepicker_scripts() {
    // ensure WP jQuery
    wp_enqueue_script('jquery');

    // If the timepicker requires jQuery UI pieces, enqueue them:
    // wp_enqueue_script('jquery-ui-core');
    // wp_enqueue_script('jquery-ui-position'); // if used by plugin

    // enqueue plugin's timepicker after jQuery
    wp_enqueue_script(
        'chauffeur-timepicker',
        get_stylesheet_directory_uri() . '/js/jquery.timepicker.min.js', // or plugin URL
        array('jquery'),
        '9.0',
        true
    );

    // optional css
    wp_enqueue_style('chauffeur-timepicker-css', get_stylesheet_directory_uri() . '/css/jquery.timepicker.min.css', array(), '9.0');
}
add_action('wp_enqueue_scripts', 'my_enqueue_timepicker_scripts', 20);
New contributor
Ankit Verma is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.