I would suggest a cleaner approach would be to implement an exclude_slugs
argument for the function, then you can just use the following in your template code:
wp_list_categories([
'exclude_slugs' => [ 'fp-feature', 'fp-aside-feature' ],
// Other arguments
]);
Here’s the filter, pop it in your functions.php
:
function wpse_217847_list_terms_exclusions( $query, $args ) {
if ( ! empty( $args['exclude_slugs'] ) ) {
if ( ! is_array( $slugs = $args['exclude_slugs'] ) )
$slugs = array_map( 'trim', explode( ',', $slugs ) );
$slugs = array_map( 'esc_sql', $slugs );
$slugs = implode( '","', $slugs );
$query .= sprintf( ' AND t.slug NOT IN ("%s")', $slugs );
}
return $query;
}
add_filter( 'list_terms_exclusions', 'wpse_217847_list_terms_exclusions', 10, 2 );
Bonus points: no additional db queries needed to first get the slug => ID translations.