Hi Sébastien,
That’s actually a little trickier than you might imagine!
I’d be happy to try and provide a spot of guidance but, ultimately, customizations like this are something we can’t always go into too much depth with. That said, perhaps this would provide a starting point for you (it’s a modification of the code you referenced in the other topic):
add_action( 'tribe_events_list_widget_after_the_meta', function() {
$categories = tribe_get_event_categories(
get_the_id(), array(
'before' => '',
'sep' => ', ',
'after' => '',
'label' => null,
'label_before' => '<dt style="display:none;">',
'label_after' => '</dt>',
'wrap_before' => '<dd class="tribe-events-event-categories">',
'wrap_after' => '</dd>',
)
);
$fragmented_html = explode( ',', $categories );
foreach ( $fragmented_html as $index => $fragment ) {
if ( false !== strpos( $fragment, '/match-home/' ) ) {
unset( $fragmented_html[ $index ] );
}
}
$category_html = force_balance_tags( join( ', ', $fragmented_html ) );
echo $category_html;
} );
Again, I can’t guarantee it will work for you right out of the box, but it essentially shows a simple string-based method for achieving your goals.
I hope it helps 🙂