WordPress.org

Make WordPress Core

Ticket #9085: 9085.diff

File 9085.diff, 2.0 KB (added by beaulebens, 6 years ago)

Adds comment_karma support to update and insert funcitons

  • comment.php

     
    873873                $comment_parent = 0; 
    874874        if ( ! isset($comment_approved) ) 
    875875                $comment_approved = 1; 
     876        if ( ! isset($comment_karma) ) 
     877                $comment_karma = 0; 
    876878        if ( ! isset($user_id) ) 
    877879                $user_id = 0; 
    878880        if ( ! isset($comment_type) ) 
    879881                $comment_type = ''; 
    880882 
    881883        $result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->comments 
    882         (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_approved, comment_agent, comment_type, comment_parent, user_id) 
    883         VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d)", 
    884         $comment_post_ID, $comment_author, $comment_author_email, $comment_author_url, $comment_author_IP, $comment_date, $comment_date_gmt, $comment_content, $comment_approved, $comment_agent, $comment_type, $comment_parent, $user_id) ); 
     884        (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, user_id) 
     885        VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %d, %s, %s, %s, %d, %d)", 
     886        $comment_post_ID, $comment_author, $comment_author_email, $comment_author_url, $comment_author_IP, $comment_date, $comment_date_gmt, $comment_content, $comment_karma, $comment_approved, $comment_agent, $comment_type, $comment_parent, $user_id) ); 
    885887 
    886888        $id = (int) $wpdb->insert_id; 
    887889 
     
    10991101                        comment_author       = %s, 
    11001102                        comment_author_email = %s, 
    11011103                        comment_approved     = %s, 
     1104                        comment_karma        = %d, 
    11021105                        comment_author_url   = %s, 
    11031106                        comment_date         = %s, 
    11041107                        comment_date_gmt     = %s 
     
    11071110                        $comment_author, 
    11081111                        $comment_author_email, 
    11091112                        $comment_approved, 
     1113                        $comment_karma, 
    11101114                        $comment_author_url, 
    11111115                        $comment_date, 
    11121116                        $comment_date_gmt,