Hi, since threading is enabled ( I assume ), it will not be added to the comment text.
To add it even without a reply link, you could still run the filter that is part of the comment reply link.
In wp-includes/comment-template.php at line 1780 there is the filter like:
/**
* Filters the comment reply link.
*
* @since 2.7.0
*
* @param string $link The HTML markup for the comment reply link.
* @param array $args An array of arguments overriding the defaults.
* @param WP_Comment $comment The object of the comment being replied.
* @param WP_Post $post The WP_Post object.
*/
return apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post );
I think you can use it like:
echo apply_filters( 'comment_reply_link', '', array(), $comment, $post );
If $comment and $post are instances of those objects it should return the “report comment” link.
Can you manage?
<?php
comment_reply_link(
array(
'reply_text' => ' ',
'depth' => $depth,
'max_depth' => 2
)
);
?>
I could directly use it like this in template, but then I must hide the link by CSS 🙁
Sure, that should be possible too.
What is your question? 🙂
(@geminith7)
3 years, 8 months ago
I created the secondary comment template base on comments.php as comments-rating.php
So reason is this template only use for rating the book cpt and I removed “reply comment” section from the loop.
How can I include the report comment button in my new comment template?