src/Ultra/Mutator/Mutator.php
public function author()
    {
        foreach($this->data as $post)
        {
            $id = $post->author;

            $author = get_userdata($id);
            $avatar = get_field('author_avatar', 'user_' . $id);
            $banner = get_field('author_banner', 'user_' . $id);

            $author = (object) [
                'name' => $author->display_name,
                'permalink' => get_author_posts_url($id),
                'images' => (object) [
                    'avatar' => $avatar ? $avatar['url'] : false,
                    'banner' => $banner ? $banner['url'] : false
                ]
            ];

            $post->author = $author;
        }

        return $this;
    }
public function author()
    {
        foreach($this->data as $post)
        {
            $id = $post->author;

            $author = get_userdata($id);
            $avatar = get_field('author_avatar', 'user_' . $id);
            $banner = get_field('author_banner', 'user_' . $id);

            $author = (object) [
                'name' => $author->display_name,
                'permalink' => get_author_posts_url($id),
                'images' => (object) [
                    'avatar' => $avatar ? $avatar['url'] : false,
                    'banner' => $banner ? $banner['url'] : false
                ]
            ];

            $post->author = $author;
        }

        return $this;
    }
public function author ( ) { foreach ( $ this -> data as $ post ) { $ id = $ post -> author ; $ author = get_userdata ( $ id ) ; $ avatar = get_field ( 'author_avatar' , 'user_' . $ id ) ; $ banner = get_field ( 'author_banner' , 'user_' . $ id ) ; $ author = ( object ) [ 'name' => $ author -> display_name , 'permalink' => get_author_posts_url ( $ id ) , 'images' => ( object ) [ 'avatar' => $ avatar ? $ avatar [ 'url' ] : false , 'banner' => $ banner ? $ banner [ 'url' ] : false ] ] ; $ post -> author = $ author ; } return $ this ; }
Include the author display name in the post object.

@return Ultra\Mutator\Mutator The mutated data object
Include the author display name in the post object .