→ facetwp_facet_html

Overview

This filter lets you modify a facet’s HTML output.

Parameters

  • $output | string | The facet HTML
  • $params | array | An associative array of facet settings (see below)

$params = array(
    'facet' => array(
        'name' => 'my_facet',
        'type' => 'checkboxes',
        'source' => 'tax/category',
        // any other facet-specific settings
    ),
    'values' => array(), // available for checkbox & dropdown facets
    'selected_values' => array(100, 101)
);

Usage

add_filter( 'facetwp_facet_html', function( $output, $params ) {
    if ( 'my_facet' == $params['facet']['name'] ) {
        $output = 'Your HTML';
    }
    return $output;
}, 10, 2 );