Add comment’s author email

//In a php file created in your WP-AppKit theme's "php" folder:
function add_comment_author_email( $comment_data, $comment_data_raw, $post_id ) {
	
	$comment_data['author_email'] = $comment_data_raw['comment_author_email'];
	
	return $comment_data;
}
add_filter( 'wpak_comments_data', 'add_comment_author_email', 10, 3 );

Then in your comments.html template:

<p>
    My author email: <%= comment.author_email %>
</p>

Add comment’s parent ID

//In a php file created in your WP-AppKit theme's "php" folder:
function add_comment_parent_id( $comment_data, $comment_data_raw, $post_id ) {
	
	$comment_data['parent_id'] = $comment_data_raw['comment_parent'];
	
	return $comment_data;
}
add_filter( 'wpak_comments_data', 'add_comment_parent_id', 10, 3 );

To Know More

Here is the section of the doc concerning the comments.html template

Published by Mathieu on January 5, 2017

Freelance Senior Web Developer, WordPress since 2009, JS/Backbone since 2012, Custom Back-End devs, WebApps and Plugins for clients and the community.

Leave a Reply

Your email address will not be published. Required fields are marked *

Having questions?

FAQ | Tutorials | Documentation

Or

Contact Us