FacetWP – pass ACF data into template

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

/**
* To access the data within the “Query Arguments” box, use:
* $this->http_params[‘choose_city’]
*/

add_action( ‘wp_footer’, function() {
$choose_city = get_field( ‘choose_city’ );
?>
<script>
(function($) {
$(document).on(‘facetwp-refresh’, function() {
FWP_HTTP.choose_city = <?php echo json_encode( $choose_city ); ?>;
});
})(jQuery);
</script>
<?php
}, 100 );
{{/gist}}