Not sure it’s the shortest way, but it works)
Get post author id
$post_author_id = get_post_field( 'post_author', $c->comment_post_ID );
Get author data by id
$post_author_display_name = get_the_author_meta( 'display_name', $post_author_id );
Try this shorter version
$output.= get_the_author_meta( 'display_name', get_post_field( 'post_author', $c->comment_post_ID ) );
Check documentation page which data is available with get_the_author_meta()
Related Posts:
- delete post also attachments
- Allow role to delete posts but block him the wp-admin
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- Delete Post From Front-End and attachment permanently
- Run a function when post is deleted?
- disable Tab post on nav-menus page (Admin)
- Format latest/newest post differently
- Optimize CPT-function with a loop
- Help on conditional statement to accompany wp_insert_post function please?
- Alt text attributes not showing over portfolio images
- How to add a custom class attribute into code wrapper? [duplicate]
- I want to change the WordPress comments file
- How to edit label_submit styling?
- Display multiple custom taxonomy values on single custom post types page?
- Setting posts_per_page for taxonomy term template
- Change post order random through out the entire WordPress
- Adding custom fields to bbpress reply form
- Move first half of posts to one parent page, second half to the other page
- Adding buttons to Add New Post and Add New Page
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- CPT archive redirects to single post
- How to display the link (title) and thumbnail post?
- Show posts by a custom post author
- Force the “Choose from the most used tags” meta box section to always be expanded
- Show the content that is after the excerpt using child theme
- Custom loop pagination links not working
- Prevent Delete Attachment by URL or When Submit
- How to allow users to post only in certain category and hide elements from edit page?
- Enable Comments Box On Custom Post Type
- wp-cli post create & media import issues
- How can i limit the number of posts created per category?
- Search results posts_orderby and ID
- How to do set post permalinks using 6 digit random unique function?
- Can’t get buddypress notifications in front-end; why do I get this error?
- Getting Custom Post Loop to display in Bootstrap 3 column grid
- Turn On Comments On Custom Post Types in Directory Theme
- WordPress custom Query for Posts in Category display posts multiple times
- Responsive images with custom image size
- Making a custom Pagination for multi page blog post
- ERROR: Your feed is invalid (after update WP4.7) in custom types
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Editing the default page to show all posts, rather than most recent ones
- Unable to restore from backup – how to obtain old blog posts?
- Automatically add date to the auto generation of post slug
- Allow users to create posts without logging in?
- Permission issue with custom post type – not added to menu – by plugin
- Duplicate Custom Post Type and Taxonomy Slug
- How could I change my Permalink from blog to custom structure? [closed]
- Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?
- Take a received feedback item, turn it into a post
- Getting value from get_post_custom
- WP Admin register taxonomy and post type performance
- Send post id through ajax and get the post content back
- Add a custom meta box in the post options that loads some html code in the header
- Static posts page with home.php
- Calling Different Custom Post Timestamps in a table
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Admin – create custom post status and display above table
- Get all images in post and comments like Twitter before post title
- custom post template file not shown, instead all the time 404.php
- Display post x of y within category
- Force authors to Preview a post before publishing
- Set Default Category to Username
- WordPress Automatic Filename Changer
- How to allow visitors to filter posts by multiple taxonomies
- show custom post type category dropdown sorting result on same page
- Custom Post Type Rewrite To Include Parent Page(s)
- Thumbnail & Category link aside post
- Redirect to another page using contact form 7? [closed]
- Order posts alphabetically: how to set order=asc in mysql query?
- How to include my own css in post
- Custom post types related to same custom post type?
- How do I insert a post with custom post type and relate it to a custom taxonomy?
- Dynamically switch template on click
- “about us”, ” contact” sections should be article(post) or page in the simple small Business website?
- Is it possible to customize the post according to post format in single.php?
- Customize rel=canonical tag for single blog post
- Change all author links in Blog roll
- a little direction on custom post type
- Adding bootstrap classes to video shortcodes
- Multiple comment forms on a single page
- Every second post different class in blog view
- is_page Funtion for Posts ?
- Custom taxonomy archive page problem
- Tell WP to use a specific template file in posts
- Post type no single page
- Is there a way to create a meta box that can be added multiple times to a post dynamically?
- relating business and products with custom taxonomy?
- Best Way to Add UnEditable HTML to Posts
- Get post meta retrieving wrong value
- How safe is it to delete old posts edits to save database space?
- Adding a user’s ID behind the tag ref link address
- Two Custom Post Types with Identical Articles Competing for the same Slug
- Custom Post Type archive
- WordPress custom post type with folder structure in slug
- Using setup_postdata() with multi-dimensional array
- The_excerpt() doesn’t parse – how to change that?
- Is codex right on deleting post?
- How to only publish posts with image in it
- Check if a custom post type has already been created