• Resolved Jeff Sterup

    (@foomagoo)


    I think this may be related to WordPress 6.5 but I’m not sure. It was working and I updated to WordPress 6.5.2 a couple of days ago. Now it is broken.

    The stylesheet used on the datepicker field is not getting included because it is trying to load https://code.jquery.com/ui/1.9.2/themes/smoothness/jquery-ui.min.css?ver=1.9.2.

    In the file /wp-job-manager/includes/class-wp-job-manager.php on line 290 there is a function that sets the version of jQuery UI and enqueues the style and script for the datepicker. But it is getting called too early. On line 109 you register an action hook:

    add_action( 'wp_loaded', [ $this, 'register_shared_assets' ] );

    Since you are enqueuing a style and script you should use the wp_enqueue_scripts and admin_enqueue_scripts action hooks instead. When the wp_loaded hook is called the global $wp_scripts variable is empty and the jQuery UI version is set to the default you have in the code which is 1.9.2 and that version no longer exists on code.jquery.com.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,

    Thanks for this report.

    I tried to reproduce it, but on my WP 6.5.2 site it is loading version 1.13.2 of the smoothness css.

    It is interesting that you are seeing the $wp_scripts variable being empty though. Can you let me know what theme and potentially other plugins are installed so we can debug this?

    Alternatively, have you tried changing themes or disabling other plugins to see if something else is conflicting with it?

    I suppose it is also possible we were looking at 2 different pages. Which page did you see the issue on? I saw it working correctly on “/post-a-job/” page with the Scheduled Date field.

    Was it a different page that you saw the wrong script version being loaded on?

    Thread Starter Jeff Sterup

    (@foomagoo)

    So this is weird. I made that change to your code and it was fixed. After you responded I went and added the plugin to a different site for testing and everything worked fine. Same theme and everything. So I went back to the original site and put the code back the way it was originally and everything works now. It was broken for a couple of days. I don’t know what happened. I guess there’s a Gremlin running around my site causing issues. False alarm.

    Plugin Support Jay

    (@bluejay77)

    Hey @foomagoo,

    That’s odd, though I’m glad to hear that it’s all good now.

    I’ll keep this thread ‘resolved’, but if the issue reappears (whilst having 3rd party themes/plugins disabled), please create a new thread with reproducible steps. Thanks!

    • This reply was modified 1 year, 10 months ago by Jay.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Datepicker missing theme’ is closed to new replies.