Using comment_notification_text
you will get comment notification text and comment ID.
To check the post type you need to get the post associated with comment and then you can check for post type
Example (Read the inline comments):
function custom_notificaion($notify_message, $comment_id) {
$comment_obj = get_comment($comment_id); //Get comment object
$comment_post = get_post($comment_obj->comment_post_ID); //Get post object
//Check if it is your post type
if (isset($comment_post->post_type) && $comment_post->post_type == 'your-post-type') {
return __('Custom message here', 'text-domain'); //Return the custom message here
}
return $notify_message; //Return default message for rest of the posts
}
add_filter('comment_notification_text', 'custom_notificaion', 10, 2);
Related Posts:
- How can the recipients and content for comment email notifications on a custom post type be changed?
- Send email messages after comment was submitted
- Why are the comments disabled by default on my custom_post_types?
- Why are comments and trackbacks still getting through for custom post types?
- Display Authors Comments on Profile Page
- List all posts commented by current user
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Custom Comment Types
- modify all posts of a category to “no comments allowed”
- Custom comment status possible?
- feed links for custom post type pages
- Admin to user notices – best practices?
- Seperating custom post type comments from regular blog posts comments
- Add comments meta fields to comments metabox on post edit screen
- Exclude post_type from admin comments_list
- Recent comments on author page?
- wp_query and comment_parent – select only posts with top level comments
- changing default comment form arguments [duplicate]
- Comment moderation on custom post types
- Automatically check “Allow comments” for custom post type [duplicate]
- Show admin help message across custom post type parent and child posts
- How to add notification in the sidebar of the administration panel when a Custom post type is created? [duplicate]
- How could I create a ‘private comments’ section on a custom post type?
- Disable comments from showing up public for Custom Post Type
- Custom Post Type loops and Disqus
- “Allow Comments” box cannot be checked
- Separate comment section for post type in dashboard
- Count all comments of a custom post type
- custom comments on specific post type
- Insert data on comment post
- Ajax Check Post Status
- get_comments not working on custom post types
- Custom Post Type Set Comments ON by default without show METABOX
- Notify admin on new submit
- WordPress comments_open for specific user role or post type
- Send notifications to custom post author when custom post is edited
- Add custom field in comments form
- Create another comment system for CPT
- Send notification to the admin when new custom post is submitted
- Convert comments to Custom Post Type
- How to assign classes to all elements?
- custom comments form for custom post type
- What functions does WordPress use for filtering / sanitizing comments?
- Delete “Post Published. View Post” for custom post type
- Send a conditional email notification when a custom field value changes in Post Type
- get comments by current user inside page template
- User-submitted reviews of different custom post types
- Check if user has comment on current post
- Enable comments on custom page type – option not showing in “customize” for theme
- Allow anonymous comments just in a custom post type
- duplicate comment section functionality and call it something else for custom post types
- comments hooks on custom post type
- custom comment fields on CPT
- unapprove comments on custom post type
- Enable comments for post when comments meta box removed
- Get the latest comment from a custom post type where depth = 1?
- Why will comments not remain open on custom post types?
- How to add comments to my custom post type but hide it from default WordPress Comments section?
- How to change the comments form title based on post type
- How to display an admin-notice after custom post type edit modification
- Comments on posts with new custom post type redirected to another post
- Display custom posts, ordered by most commented, without duplicates
- How to check if a new private custom post type is created?
- get comments for custom post type
- How to create a discussion post when a custom post is created?
- how to display notifications in the wordpress menu when a new post is published
- Adding second comments.php for reviews
- Custom post type updated to support comments, yet comments don’t appear
- BCC email to subscribers
- Comments not enabled for custom post types
- Turn off comments for given CPT checkbox?
- Author profile comments system
- Custom post type: can’t enable comments by default
- Comment moderation with disqus comments
- add comments custom fields after user is logged in
- Comments are not working on Custom Post Type
- Error 403 when posting comments to a custom post type from a different page
- Comments not working (error not allowed) on posts with custom post status
- How do I add the “orange counter” next to a Custom Post Type?
- Many to Many Relationship between Two Custom Post Types
- how to group custom post type posts by custom taxonomy terms
- Custom post type permalink missing /post_type/ front
- Including Custom Post Type posts in a page template contextually (or should I widget?)
- Custom posts don’t work
- Pagination is not working in custom post type
- Two Custom Post Types Many to Many Relationship
- Single post with a Custom Post Type returns 404, when archives of the CPT work correctly
- Deny user access to edit post while allow him to edit custom post type
- Pros and cons of a custom page vs custom post type template file
- Get id from metabox dropdown
- How can I add custom fields in a custom post type? [duplicate]
- Get List of Terms based on a given term (different taxonomy)
- Add rewrite rule for custom post type single page
- After inserting new post with wp_insert_post() the post is not visble to WP_Query, but the same WP_Query works for post inserted from wp-admin panel
- Possition a Custom Post Type Tab under Settings
- Pretty permalink structure with multiple (AND OR) taxonomies
- WordPress Custom taxonomy template
- Diffrent search templates for different post types
- Display div based on Group metabox selection [closed]
- custom taxonomy not return in the code