src/Ultra/Mutator/Mutator.php
public function taxonomy($name)
    {
        foreach($this->data as $post)
        {
            $terms = get_the_terms($post->ID, $name);

            if(!empty($terms))
            {
                $term = array_values($terms)[0];

                $post->$name = (object) [
                    'name' => $term->name,
                    'permalink' => get_term_link($term->slug, $name)
                ];
            }
        }

        return $this;
    }
public function taxonomy($name)
    {
        foreach($this->data as $post)
        {
            $terms = get_the_terms($post->ID, $name);

            if(!empty($terms))
            {
                $term = array_values($terms)[0];

                $post->$name = (object) [
                    'name' => $term->name,
                    'permalink' => get_term_link($term->slug, $name)
                ];
            }
        }

        return $this;
    }
public function taxonomy ( $ name ) { foreach ( $ this -> data as $ post ) { $ terms = get_the_terms ( $ post -> ID , $ name ) ; if ( ! empty ( $ terms ) ) { $ term = array_values ( $ terms ) [ 0 ] ; $ post -> $ name = ( object ) [ 'name' => $ term -> name , 'permalink' => get_term_link ( $ term -> slug , $ name ) ] ; } } return $ this ; }
Include the first taxonomy term name in the post object.

@param string $name The taxonomy name
@return Ultra\Mutator\Mutator The mutated data object
Include the first taxonomy term name in the post object .