X Features Cars Demo Power Plants Demo State Parks Demo Site Showcase Docs Tutorials Add-ons Buy

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

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