facetwp allowinput datepicker

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php

/** add js to footer to modify date_range options **/
add_action( ‘wp_footer’, function() { ?>
<script>
(function($) {
if ( ‘undefined’ !== typeof FWP ) {
FWP.hooks.addFilter(‘facetwp/set_options/date_range’, function(flatpickr_opts, extras) {
flatpickr_opts[‘allowInput’] = true;
return flatpickr_opts;
});
}
})(jQuery);
</script>
<?php }, 100 );
{{/gist}}