Event Calendar – index related venue

mgibbs189

{{gist file=”functions.php” lang=”php”}}
<?php

// Add to functions.php
// Change “YOUR_FACET_NAME_HERE” to the actual facet name (not label)
// Set your facet’s data source to “_EventVenueID”

add_filter( ‘facetwp_index_row’, function( $params, $class ) {
if ( ‘YOUR_FACET_NAME_HERE’ == $params[‘facet_name’] ) {
$venue_id = (int) $params[‘facet_value’]; // the venue’s post ID can remain the slug
$params[‘facet_display_value’] = get_title( $venue_id ); // set the venue title as the label
}
return $params;
}, 10, 2 );
{{/gist}}