-
-
Save garubi/8ecf136eb522e6425e02ac273f8558c4 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('you@hotmail.com'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment