Reply To: Disable

Home Forums Front End PM PRO Disable Reply To: Disable


Found the solution! FacetWP includes this documentation:

Pass authentication data through REST API requests:

I needed to add the following code and now things work as they should:

  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() {
(function($) {
  $(function() {
    FWP.hooks.addFilter('facetwp/ajax_settings', function(settings) {
      settings.headers = {
        'X-WP-Nonce': FWP_JSON.nonce
      return settings;
}, 100 );