Advertisement
Guest User

Untitled

a guest
May 31st, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. function wpd_comment_notification_text( $notify_message, $comment_id ){
  2. // get the current comment and post data
  3. $comment = get_comment( $comment_id );
  4. $post = get_post( $comment->comment_post_ID );
  5. // don't modify trackbacks or pingbacks
  6. if( '' == $comment->comment_type ){
  7. // build the new message text
  8. $notify_message = sprintf( __( 'A new reviewer wants to receive "%s"' ), $post->post_title ) . "rn";
  9. $notify_message .= sprintf( __('Author : %1$s'), $comment->comment_author ) . "rn";
  10. $notify_message .= sprintf( __('E-mail : %s'), $comment->comment_author_email ) . "rn";
  11. $notify_message .= sprintf( __('When you are logged, you can see details about the reviewer reputation here: %s'), get_comment_link( $comment_id ) ) . "rn";
  12.  
  13. if ( user_can( $post->post_author, 'edit_comment', $comment_id ) ) {
  14. if ( EMPTY_TRASH_DAYS )
  15. $notify_message .= sprintf( __(''), admin_url("comment.php?action=trash&c=$comment_id") ) . "rn";
  16. else
  17. $notify_message .= sprintf( __(''), admin_url("comment.php?action=delete&c=$comment_id") ) . "rn";
  18. $notify_message .= sprintf( __(''), admin_url("comment.php?action=spam&c=$comment_id") ) . "rn";
  19. }
  20. }
  21. // return the notification text
  22. return $notify_message;
  23. }
  24. add_filter( 'comment_notification_text', 'wpd_comment_notification_text', 20, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement