FacetWP – show the related author field (Pods)

mgibbs189

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

add_filter( ‘facetwp_builder_item_value’, function( $value, $item ) {
if ( ‘cf/related_recipe_author’ == $item[‘source’] && is_array( $value ) ) {
$author_id = $value[0]; // get the author ID (first array element)
$value = get_the_title( $author_id ); // get the post title
}
return $value;
}, 10, 2 );

{{/gist}}