Created
January 15, 2019 14:02
-
-
Save jchristopher/3c3eaad893955e0b4d15018b92647217 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* | |
Please note that caching may interfere with the NONCE, | |
causing ajax requests to fail. Please DISABLE CACHING for facet pages, | |
or set the cache expiration to < 12 hours! | |
*/ | |
add_action( 'wp_footer', function() { | |
?> | |
<script> | |
(function($) { | |
$(function() { | |
FWP.hooks.addFilter('facetwp/ajax_settings', function(settings) { | |
settings.headers = { | |
'X-WP-Nonce': FWP_JSON.nonce | |
}; | |
return settings; | |
}); | |
}); | |
})(jQuery); | |
</script> | |
<?php | |
}, 100 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment