Getting comments of an specefic user

You could try this way: <?php $my_user = get_current_user_id(); $args = array( ‘post_type’ => ‘custom-post-type’, ‘user_id’ => $my_user, ); $comments = get_comments($args); foreach($comments as $comment) : echo($comment->comment_author . ‘<br />’ . $comment->comment_content); endforeach; ?> Provided that your user has comments!!

Sending comment notifications to different recipients depending on taxonomy terms

Finally I found the right code, if it can be usefull to someone: function sp_comment_moderation_recipients( $emails, $comment_id ) { $comment = get_comment( $comment_id ); $post = get_post( $comment->comment_post_ID ); if ( has_term(‘myterm’,’mytaxonomy’, $post->ID) ) { return array( ‘[email protected]’ ); } return $emails; } add_filter( ‘comment_moderation_recipients’, ‘sp_comment_moderation_recipients’, 10, 2 ); add_filter( ‘comment_notification_recipients’, ‘sp_comment_moderation_recipients’, 10, 2 );

how to remove WordPress default comment system

Add this code to your functions.php it removes the comment hooks that are default with WordPress. If you ever want to reenable the comments just remove this code from your functions.php // Add to existing function.php file // Disable support for comments and trackbacks in post types function df_disable_comments_post_types_support() { $post_types = get_post_types(); foreach ($post_types … Read more

Sent comments notifications to multiple users

Something like this should work: add_filter(‘comment_notification_recipients’, ‘override_comment_notice_repicient’, 10, 2); function override_comment_notice_repicient($emails, $comment_id) { $admins = get_users( array( ‘role__in’ => array(‘administrator’), ) ); foreach ( $admins as $user ) { $emails[] = $user->user_email; } return ($emails); }