FacetWP – layout builder – hide title if an excerpt exists

mgibbs189

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

// Add to your (child) theme’s functions.php

add_filter( ‘facetwp_builder_item_value’, function( $value, $item ) {
if ( ‘post_title’ == $item[‘source’] ) {
$excerpt = get_the_excerpt( $GLOBALS[‘post’]->ID );

if ( ! empty( $excerpt ) ) {
$value = ”; // clear the layout builder item value
}
}
return $value;
}, 10, 2 );

{{/gist}}