Javascript errors on WP >4.5.4
-
Hi!
On WordPress > 4.5.4 and events-maker v.1.6.11, if you have enabled language other then en_US user interface on admin area is broken. As You can see on the image there are some javascript errors in console.
I’m not exactly sure what causes this behavior, but it’s clearly related to WordPress update from 4.5.x to 4.6.x
To fix this you have to change:
wp_register_script( 'events-maker-datetimepicker-localization', $lang_path, array( 'jquery', 'events-maker-datetimepicker' ) );
to:
wp_register_script( 'events-maker-datetimepicker-localization', $lang_path, array( 'jquery', 'events-maker-admin-post' ) );
in file includes/libraries/class-metaboxes.php: ~185 line in method admin_scripts_styles
As I figured out, if you are using in your WP installation language for which ‘jquery-ui-timepicker’ translation is provided, then above code is executed and ‘jquery-ui-timepicker-addon.min.js’ is loaded before ‘jquery-ui-datepicker’, and this ‘addon’ is trying to extend ‘datepicker’ which causes js errors and breaks user interface.
—
One more thing, I’m using WP pl_PL but I also tried it in de_DE and it_IT.
- The topic ‘Javascript errors on WP >4.5.4’ is closed to new replies.