Advertisement
Guest User

wp_comment_at

a guest
Nov 28th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. <?php
  2. // Comment At
  3. function wp_comment_at ($comment_text, $comment = ''){
  4.     if ($comment->comment_parent > 0) {
  5.         $parrent        = $comment->comment_parent;
  6.         $parrent_author = get_comment_author($parrent);
  7.         $comment_text   = '@<a href="#comment-' . $parrent . '">' . $parrent_author .'</a> : '.$comment_text;
  8.     }
  9.     return $comment_text;
  10. }
  11. add_filter('comment_text', 'wp_comment_at', 20, 2);
  12. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement