• Viktor Szépe

    (@szepeviktor)


    How is it possible (in 1-2 lines of code, without a plugin) to prevent sending moderation emails to the admin?
    I’d like modertaion emails for unapproved comments to be sent to the post’s author only.

    1728      if ( 'spam' !== $commentdata['comment_approved'] ) { // If it's spam save it silently for later crunching
    1729          if ( '0' == $commentdata['comment_approved'] ) {
    1730              wp_notify_moderator( $comment_ID );
    1731          }
    1732
    1733          // wp_notify_postauthor() checks if notifying the author of their own comment.
    1734          // By default, it won't, but filters can override this.
    1735          if ( get_option( 'comments_notify' ) && $commentdata['comment_approved'] ) {
    1736              wp_notify_postauthor( $comment_ID );
    1737          }
    1738      }
  • The topic ‘comment moderation email only to the author’ is closed to new replies.