facetwp custom data in json

djrmom

{{gist file=”custom-hooks.php” lang=”php”}}
<?php
/** return custom data in the json facet returns on refresh
** access with FWP.settings.my_data in JS
*/
add_filter( ‘facetwp_render_output’, function( $output, $params ) {
$output[‘settings’][‘my_data’] = ‘some data’;
return $output;
}, 10, 2 );
{{/gist}}