[wp-trac] [WordPress Trac] #32851: Update old comments with registered user email address change issue.

WordPress Trac noreply at wordpress.org
Wed Jul 1 05:13:02 UTC 2015


#32851: Update old comments with registered user email address change issue.
-----------------------------------------+-----------------------------
 Reporter:  ravipatel                    |      Owner:
     Type:  defect (bug)                 |     Status:  new
 Priority:  normal                       |  Milestone:  Awaiting Review
Component:  Comments                     |    Version:  4.2.2
 Severity:  normal                       |   Keywords:
  Focuses:  administration, performance  |
-----------------------------------------+-----------------------------
 when i have register on blog and i have add 4 comment on different post.
 Now 2'nd day i have change  my email address on my profile.

 now any one comment's reply is email gone my old email address which is
 not change after profile update on comments.

 i have fix this issue on one member please review it 2 link for more info.

 i hope u will understand me.

 [https://wordpress.org/support/topic/update-old-comments-with-new-
 registered-user-email-address?replies=6]

 [https://wordpress.org/support/topic/development-bump]


 now i have fix this bug using this one code


 {{{
 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);
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32851>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list