Initially it seemed like a good idea to add comment_notification_text
inside the pre_comment_on_post
hook, but it didn’t go well. So I removed the pre_comment_on_post
and just added to comment_notification_text
a comment type check, which is related to the CPT for which the comments are. Now my code works fine for both comment categories (moderated and not).
add_filter( 'comment_notification_text', function( $notify_message, $comment_id ) {
if( 'message' !== get_comment_type( $comment_id ) ) { return $notify_message; }
// the rest of the code
return $message;
}, 10, 2 );
Related Posts:
- How to change the email notification recipient (user) for new comments?
- Multiple Comment Moderators and Notifications
- Sending comment notifications to different recipients depending on taxonomy terms
- 3 moderators to approve comment
- How to auto-approve internal pingbacks?
- How can I edit the email sent when a new comment is received?
- Exclude internal links from comment moderation?
- Plugin from WordPress.com for comment notification…available? [closed]
- Add delete, approve, spam Links to Comments
- If new comment posted in custom post – send notification to custom email from custom field
- Disable Admin account being emailed for comment notification
- WordPress comments email notification for authors
- Get the number of comments awaiting moderation
- Capability for allowing user to post own comments without moderation
- Send Notifications to All Admins
- Why do comment moderators need to have all create/edit/delete toboth posts and pages?
- Community Moderation Plugin for Comments [closed]
- Allow contributors to moderate comments comments on posts they write
- Hold comments for moderation only if user is not logged in
- show if comment is in moderation
- Follow-up Comments Notification Without a Plug-in
- Reject Comments Based on Author Email
- Author can only see own post comment and can moderate
- How to moderate (manually approve) comments of a specific (registered) User
- Comment Moderation and CDN Caching
- WordPress comments – how to check if comment still needs to be approved?
- Email notification to an email address other than admin for custom type post comments in wordpress
- Notify post author for a new comment on his post?
- Reply By Email to comment notifications
- Why does akismet prevent jetpack comments from appearing in my moderation queue? [closed]
- How Do I Allow Comment Moderation for Other User’s Posts?
- How do I disable the discussion notification emails to us when a comment is “approved” and when an adiministrator replies?
- Who approved a comment, to show up in dashboard
- Can I allow registered users to comment without being logged in or having to be approved?
- Comment moderation
- Not receiving any e-mails after new comment
- How can I see whether a commenter has subscribed to be notified of replies / other comments to a post
- Disable comment moderation in multisite
- Comment notification not working
- Comment Blacklist
- Subscribe to a post’s comments without posting a comment yourself
- Embed a page within WordPress dashboard?
- comment awaiting moderation
- Comments screen in backend, how to disable email address of commenter for non admins
- How can I limit the number of comments per registered user per day?
- Parent comment’s author name
- get_comments_number of depth-1 (Level 1) (1 post)
- How can I control the comment counts filtering my CPT replies?
- Can I store my custom comment_type into wp_comments table?
- Number of External Links in Comments – Moderation Option
- What is comment_karma?
- How to override function twentyten_comment
- How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form
- Enable Recent Comments widget to display comments on attachment posts
- Change allowed HTML tags for comments
- How can I highlight admin comments?
- On WordPress 4.4, how to get the post id using the comment_post hook
- Block comments from search engine indexing
- Add action on delete comments?
- Exclude child comments in get_comments() or WP_Comment_Query?
- Can’t seem to get this CSS to work…any ideas why? [closed]
- Change order of comment fields
- WordPress custom form action url
- How to add a strip of visual editor on top of comments textarea
- comment_post action hook running on page load instead of after a comment is posted
- woocommerce allow users to select or use avatar
- How to sort posts by the average of comment meta values
- Problem with Comment link in Blog [closed]
- Commenting in user profile page?
- Can i Use own Facebook App ID with this Social Comment Plugin? [closed]
- How do i hide all comments from logged out users
- Only allow the post author and admin to comment on a post
- Show Social Sharing Buttons And Facebook Comments In Lightbox Modal Dialog (Image Overlay)?
- Grant a person permission to moderate all comments on a blog without giving them the ability to edit other peoples post
- How come pending comments are appearing in admin?
- Generate Sub-Comments with WP-CLI [closed]
- comment_date() & comment_time() not working from functions.php
- Repositioning ‘Reply’ Link in Comments
- Add an attachment feature to comments
- Counting Comments as Singular and Plural in comments.php Template
- How to get Post title by locale with Qtranslate-X
- Retrieve the last 5 comment URLs
- WordPress comment for virtual page
- Admin Dashboard – Recent Comments source
- Genesis Child Theme Modifying Comments display
- Hide Trackbacks/Pingbaks if none exists
- How to use filter on comment submission/insert
- Comment Pagination
- See some statistics about the comments
- Custom comment types. Are they a possibility?
- How to output comments in Descending order by date using wp_list_comments?
- Re-Direct After Comment Submit IF Comment Comes from Sign-Up Page
- Is there a way to link to the BOTTOM of the comments on a wordpress page?
- How to pass settings to comment_form() if theme only uses comments_template()?
- reply to comment excerpt instead of author in comment title
- different levels of nested comments per page
- approve,spam,trash etc. options are not coming on comments in admin panel
- Actual comments not showing, but form is?
- Number of unpublished comments for each post
- Add pending for reply comment in console WordPress