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?
- Add a checkbox to post screen that adds a class to the title
- Getting the post_id in wp_ajax function
- Attach pdf file to custom post type
- How to call function within a page/post, to dynamically generate content?
- Static posts page with home.php
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Force update all posts in custom post type, no content changes
- Add custom field to category of custom post type
- Disable REST API for a user ROLE
- Add confirmation popup on “Move to Trash”
- What Can I Use To Add A Custom Button Between Publish button and Move To Trash?
- user contributed content as custom post types
- Remove custom posts that match taxonomy value
- Custom Theme Want To Remove One Category From All Displays
- How can I list random authors from current post category?
- Post Type Label Name
- wp_query ‘s’ parameter does not work with custom post type
- Getting current post ID in functions.php
- Blog Posts in Custom Menu
- How to display data in archive page?
- Load post attached images on a single page site with fancybox
- Setting posts_per_page for taxonomy term template
- Change post order random through out the entire WordPress
- Custom Post Type – Category Rewrite – Remove Rewrite from Sitemap
- CPT archive redirects to single post
- Prevent Delete Attachment by URL or When Submit
- Enable Comments Box On Custom Post Type
- Turn On Comments On Custom Post Types in Directory Theme
- Duplicate Custom Post Type and Taxonomy Slug
- Calling Different Custom Post Timestamps in a table
- How to allow visitors to filter posts by multiple taxonomies
- How to include my own css in post
- a little direction on custom post type
- How to only publish posts with image in it
- Create a custom posts page
- Deleted a user with administrator rights. Now all the data/content/images are lost. how to recover them back
- register_post_type permalink
- Using system date format
- Custom Post Limit for homepage only without plugin?
- Static pages not working
- Post titles and thumbnails as links to custom post types?
- Adding a custom post type meta field to rss
- Help with listing current users submitted custom post type in template file
- Deleting old posts
- How To Use Custom Tax of a Post Type
- shortcode // get posts by ids
- get posts, run a custom query, and join the results
- search form for custom fields
- Search results for ACF data
- Redirect to custom post if custom archive page has just one result?
- Multiple posts in one page
- delete post hook not being fired when deling in wordpress dashboard admin
- Replace Tag Keyword With Link Within Post Content
- WordPress Delete Users from backend doesn’t work
- Is it possible to make a custom post that adds multiple pages?
- Loop through taxonomies and loop through their terms (Newbie question)
- Custom post styling per category?
- How to change number of posts shown on homepage vs other pages?
- Hook To Get All Posts Deleted
- Meta boxes not saving
- Custom URL Structure for posts with subcategories
- How to show the posts list into a static page? Problems to use the loop into a static page
- Get new post meta data when (custom) post is saved
- Allow users to create their own page/s
- 404 for some custom taxonomy not ALL taxonomy
- Get post title by Alphabet
- Given two custom post types: Automatically add meta fields from one custom post type to another
- Display metabox with date
- How can i retrive the movies, trailers, news in a single page using search
- How can I create a menu items from meta box based on users input
- How to use wp_editor(); in functions.php then retrieve content in the template
- Add default content to post (for specific category)
- get post custom value
- WordPress strips some attributes for author posts
- Display one post randomly from category on home page
- save_post not working
- Deleting first four characters from all Post Titles
- Deleling wordpress posts permanently still have IDs
- wp trim function not working
- Post’s arent displaying
- Can I get custom post items in select box (dropdown)
- How to have 2 posting pages on a blog
- display last post modified date in genesis child themes
- Custom Post-Rename Function Does Not Function in WordPress 6.x
- Dynamic Menu Item
- I have a website issue I am trying to resolve
- How to sort posts alphabetically based on a specific parent category