→ facetwp_assets

Overview

Control which javascript or CSS files are rendered. The added benefit of this hook is that these assets will only load on facet pages.

Parameters

  • $assets | array | An associative array of assets to load

Usage

Add your own custom javascript file to facet pages:

add_filter( 'facetwp_assets', function( $assets ) {
    $assets['custom.js'] = 'URL/TO/YOUR/custom.js';
    return $assets;
});

Or, remove an existing file if needed:

add_filter( 'facetwp_assets', function( $assets ) {
    unset( $assets['event-manager.js'] );
    return $assets;
});

Available Keys

  • event-manager.js
  • front.css
  • front.js
  • front-facets.js
  • jquery.autocomplete.css
  • jquery.autocomplete.js
  • flatpickr.css
  • flatpickr.js
  • fSelect.css
  • fSelect.js
  • gmaps
  • nouislider.css
  • nouislider.js
  • nummy.js
  • edd.js
  • query-string.js
  • woocommerce.js