// facetwp_render_params

Overview

Modify the raw data passed from AJAX into the FWP_Facet->render() method.

Parameters

  • $params | array | An array of input data (see below)

$params = array(
    'facets' => array(
        array(
            'facet_name' => 'facet_1',
            'selected_values' => array( 'foo' )
        ),
        array(
            'facet_name' => 'facet_2',
            'selected_values' => array( 'foo', 'bar' )
        )
    ),
    'template' => 'example',
    'http_params' => array( 'uri' => 'demo/cars' ),
    'extras' => array(),
    'soft_refresh' => 0,
    'is_bfcache' => 1,
    'first_load' => 0,
    'paged' => 1,
);

Usage

Modify the passed in URI:

add_filter( 'facetwp_render_params', function( $params ) {
    $params['http_params']['uri'] = 'foo/bar';
    return $params;
});