Not tested, but from quick look something like this should work:
$comment = get_comment($commentID);
$post = get_post($comment->comment_post_ID);
$user = get_userdata($post->post_author);
if( $comment->user_id == $post->post_author )
return;
Related Posts:
- Individual Comment Notification Setting For Post Author
- Disabling Comment Notifications for Post Author
- Get total number of comment of the posts written by an author
- Notify comment author upon reply
- How to show a message to a user?
- Disable update notification for individual plugins
- Disable email notification after change of password
- How to export comments in WordPress?
- What are the package and subpackage comment for?
- Experiences with adding Nonces to the comment form
- Publish author posts only with editor approval?
- Is there a plugin for posting inline comments, like in MS Word? [closed]
- Send email when a new post is published [closed]
- Disable saving comment details (name, e-mail) in cookie?
- Facebook comments box on front page
- Are there any drawbacks to install IntenseDebate on my blog?
- Set a User as Author of all ‘New Posts’ posted
- Installing Facebook comment plug in without loosing all previous wordpress comments?
- Notify commenters about new replies
- How to notify users of blog updates a la Admin Plugin Update notifications?
- Having Multiple authors for the same WordPress Plugin
- How to develop a community feature in the dashboard for multiauthor site
- Custom comment type maybe?
- Change destination author link
- Use comments as notes, visible for comment author only
- Plugin from WordPress.com for comment notification…available? [closed]
- How does WooCommerce display a custom comment_type in Comment Admin?
- How to prevent spam comments?
- Intercept comment form submit/list by hook/filter
- adding a text message beside the comment submit button
- How to add a privacy-checkbox in comment-template?
- Plugin: How should I handle deleting comments?
- wordpress plugin that show my reputation (points) in any stackexchange project in my wordpress blogs
- Akismet plugin is deleting spam despite preferences
- Plugin Functionality Only for Editor and Administrator
- PGP-Encrypt system-generated notifications
- Improving a Stackoverflow “inspired” badge system to display badges in author page
- Override comments.php template with plugin
- Leveraging WordPress Comments on Custom Plugin Object page
- Display comments of users on single page
- Function to prevent users from trashing comments
- add_filter comment_edit_redirect not working
- How do you override the default comment template?
- How to change commenter links to /user/user_id?
- Facebook plugin shows existing comments
- unregistered user can write in blog page – possible? how to?
- How can I get WordPress to save comments in markdown format?
- Is there a hook that is called only once after plugin bulk update process is completed?
- Not getting author rank when using return
- Creating a plugin to sanitize comment and the url field before display only
- WordPress independent plugin upgrade notification system [duplicate]
- Facebook-like Notification Plugin for WordPress Community Blog Sites?
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- Custom post type – no layout section of Document tab, and no author choice
- Notify post author for a new comment on his post?
- Modifying Author Link to add Author Meta in URL
- Send reply with pre-prepared answers
- posts comments goes to trash
- How to set add question capability for author role in wp pro quiz plugin
- Comment section not showing correctly
- Disqus deleted comments are syncing with wordpress but active comments do not
- Automatically Assign Author to Category [closed]
- Include comments form in plugin page
- WordPress 4.2.1 pre_get_comments doesn’t work after update
- Co-Authors Plugin Displaying Wrong Author
- Integrate Facebook comments with native comments
- Post Comments with Ajax in WordPress
- Change get_current_user_id code to the author’s profile
- allow photo/video in comments
- Can I put in Github the code of a abandoned plugin I want to fork?
- Show author on every sub-page
- Custom setup of wordpress comments that are displayed
- Is there a specific term for Plugins that are specified in a WordPress Post using Comments?
- Modify wp_installed_email / wp_new_blog_notification
- Add back to post link on blank comment post error page
- Flag Comment as inappropriate button plugin
- Help with comments.php
- Some WordPress Posts are automatically becoming comments on other Posts
- Comment IP Plugin – Fixing onfocus=’this.select()’
- Woocommerce: limit user to see only the products he created
- OceanWP settings are missing from Add New Post [closed]
- get_comments_number() giving wrong results! What are alternatives?
- Moving FB comments at the end of page
- how to add custom info on author page? plugin, child theme?
- Comment Approve – Add custom function when comment is approved
- How to save comment name email url fields?
- Personalized Author Area
- Add a Custom Field in Comment Box next to the Text area
- Error: Can´t access facebook comment plugin admin page
- Separate jQuery for Individual Comments?
- how can authors to define custom pages?
- Is there a way to input different rel=author and rel=publisher attributes for a WP blog w/ multiple authors?
- How can i list random author?
- Pull comments from one page/post into another page/post?
- Engadget Like most commented plugins
- Does anyone know what’s the plugin for this Comment Section?
- Send a Notification to a WordPress Theme
- Display WordPress comments before the plugins?
- Author & date removal
- Adding plugin editing capability for Author