wp_enqueue_scripts vs admin_enqueue_scripts


As all yout code is in the back-end, why don't you use admin_enqueue_scripts instead of wp_enqueue_scripts? It loads the datepicker and combobox stuff, but it don't need it on the front end...

It'll make the front-end really lighter.

Other little comment:

I think it misses jquery.ui.datepicker-en in /custompress/datepicker/js/i18n/ as it produces a 404 error...

  • Arnold
    • El Macho WP

    Actually it is used on the Front end. Input of dates in Directory and Classifieds and any CustomPress inputs on the front end will need it.

    As for the language file. 'en' is the native built in language for both Wordpress and Datepicker. wp-config.php where WPLANG is defined is normally set to an empty string and would not call for an 'en' file and Datepicker wouldn't need one either.

    So someone must have set your WPLANG to 'en' for it to be asking for it. You can either change it back to '' or you can add your own language file, which is what would happen if you translated to another language.

    There is some question about whether this is a bug and what to do about it, which have been milestoned to Datepicker version 1.11.0. You can see the discussion here and use the proposed file listed there if you like.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.