Last active
February 19, 2019 16:57
-
-
Save djrmom/1ddacfd21b9c7e42e0614dcf2722d6cb to your computer and use it in GitHub Desktop.
facetwp allowinput datepicker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment