Is it possible to somehow enqueue a Flatpickr localization js into WordPress install (via wp_enqueue_script) and tell Bricks to load local file?
Hi, @timmse
2.0 changelog say that ‘bricks-flatpickr-l10n JS files host locally’, does it include translations too?
To load Flatpickr localization JS locally in WordPress and ensure it works with Bricks Builder:
-
Enqueue the Flatpickr and localization scripts in your theme’s
functions.php
:function enqueue_flatpickr_localization() { wp_enqueue_script('flatpickr-js', get_template_directory_uri() . '/js/flatpickr.min.js', [], '4.6.9', true); wp_enqueue_script('flatpickr-localization', get_template_directory_uri() . '/js/flatpickr-locale-XX.js', ['flatpickr-js'], '4.6.9', true); } add_action('wp_enqueue_scripts', 'enqueue_flatpickr_localization');
-
Load the localization file after Bricks Builder:
function load_flatpickr_localization_after_bricks() { wp_enqueue_script('flatpickr-localization'); } add_action('wp_footer', 'load_flatpickr_localization_after_bricks');
This ensures the localization file is properly loaded and works seamlessly with Bricks. Simple and effective!
Hi @Illarion ,
In 2.0-alpha, Bricks will host them locally.
Please try 2.0-alpha and give us feedback if you can.
Regards,
Jenn
1 Like