in this thread, the amazing Ravi Patel pointed me towards a solution for my issue that old comments wouldn’t be updated with a new (registered) user’s email address. He fixed it with a simple function that I thought might as well be included in the plugin. Mention him please though as it’s his work, not mine.
I’ve tested it and it works beautifully!
function user_profile_update($user_id) {
$commentarr = array();
global $wpdb;
if( !current_user_can( 'edit_user', $user_id ) ){
return false;
}
if(isset($_POST['email'])):
echo $email = esc_attr($_POST['email']);
$wpdb->query("UPDATE $wpdb->comments SET comment_author_email='$email' WHERE user_id=$user_id");
endif;
}
add_action('personal_options_update','my_profile_update', 10,2);
add_action('profile_update', 'user_profile_update', 10,2);
(@12ax7)
8 years, 8 months ago
Hello there,
in this thread, the amazing Ravi Patel pointed me towards a solution for my issue that old comments wouldn’t be updated with a new (registered) user’s email address. He fixed it with a simple function that I thought might as well be included in the plugin. Mention him please though as it’s his work, not mine.
I’ve tested it and it works beautifully!
https://wordpress.org/plugins/comment-email-reply/