<?php
/**
* Usage:
*
* 1. Add the following to your (child) theme's functions.php
* 2. Create a new facet named "post_id"
* 3. Set its data source to "Post Type" (this serves as a placeholder)
* 4. Save and re-index
*/
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'post_id' == $params['facet_name'] ) {
$params['facet_value'] = $params['post_id'];
$params['facet_display_value'] = $params['post_id'];
}
return $params;
}, 10, 2 );