Apply filter array/return terms



PHP Snippet 1:

add_filter( 'uael_posts_tax_filter', function( $terms ) {
$new_terms = array();
foreach ( $terms as $index => $tax ) {
    if( 'video-genres' === $tax->taxonomy ) { 
        $new_terms[] = $tax;
    }
}
return $new_terms; }, 10, 2 );

PHP Snippet 2:

add_filter( 'uael_posts_tax_filter', function( $terms ) {

   $terms[] = 'video-genres';
  return $terms;
}, 10, 2 );

PHP Snippet 3:

add_filter('uael_posts_tax_filter', 'custom_uael_posts_tax_filter', 10, 2);
function custom_uael_posts_tax_filter($terms)
{
    // Modify the array here.
    if ($terms) {
        $terms[] = 'video-genres';
    }

    return $terms;
}