-
-
Save jevgen/c9968b1c1f97763e829ab490514a83ad to your computer and use it in GitHub Desktop.
Change comment notification recipient for Shopp products
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('comment_notification_recipients', 'override_comment_notice_repicient', 10, 2); | |
function override_comment_notice_repicient($emails, $comment_id) { | |
$comment = get_comment( $comment_id ); | |
if ( empty( $comment ) ) | |
return $emails; | |
$post = get_post( $comment->comment_post_ID ); | |
if ( $post->post_type != "shopp_product") | |
return $emails; | |
return array('[email protected]'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment