Locale filter in conjunction with new datepicker localization
I was able to successfully change the datepicker’s strings to a different locale for a single page using the switch_to_locale() function introduced in WordPress v4.7. switch_to_locale() will modify the global $wp_locale variable which is used by wp_localize_jquery_ui_datepicker(). Changing the locale with the locale filter alone does not overwrite $wp_locale. /** * Use switch_to_locale() on a … Read more