WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #43442, comment 7


Ignore:
Timestamp:
04/03/2018 06:21:27 PM (4 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #43442, comment 7

    initial v1  
    11Looking at 43442.diff, thinking we may be better off doing a custom db query. Updating each comment in a loop would be very ineffective. Perhaps something like:
    22{{{
    3 $anon = __( 'Anonymous' );
    4 
    53$wpdb->query(
    6     $wpdb->prepare( "UPDATE $wpdb->comments SET comment_agent = '', comment_author = '$anon', comment_author_email = '', comment_author_IP = '0.0.0.0', comment_author_url = '', user_id = 0 WHERE comment_author_email = '$email'" )
     4    $wpdb->prepare( "UPDATE $wpdb->comments SET comment_agent = '', comment_author = %s, comment_author_email = '', comment_author_IP = '0.0.0.0', comment_author_url = '', user_id = 0 WHERE comment_author_email = %s", __( 'Anonymous' ), $email )
    75);
    86}}}