Skip to content

Instantly share code, notes, and snippets.

@jevgen
Forked from clifgriffin/gist:8827396
Created October 8, 2016 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jevgen/c9968b1c1f97763e829ab490514a83ad to your computer and use it in GitHub Desktop.
Save jevgen/c9968b1c1f97763e829ab490514a83ad to your computer and use it in GitHub Desktop.
Change comment notification recipient for Shopp products
<?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