mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-28 07:07:38 +02:00
Make comment_karma accessible from normal comment API functions, props beaulebens, fixes #9085
git-svn-id: http://svn.automattic.com/wordpress/trunk@10536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3641891df0
commit
fdcf39c107
@ -873,15 +873,17 @@ function wp_insert_comment($commentdata) {
|
|||||||
$comment_parent = 0;
|
$comment_parent = 0;
|
||||||
if ( ! isset($comment_approved) )
|
if ( ! isset($comment_approved) )
|
||||||
$comment_approved = 1;
|
$comment_approved = 1;
|
||||||
|
if ( ! isset($comment_karma) )
|
||||||
|
$comment_karma = 0;
|
||||||
if ( ! isset($user_id) )
|
if ( ! isset($user_id) )
|
||||||
$user_id = 0;
|
$user_id = 0;
|
||||||
if ( ! isset($comment_type) )
|
if ( ! isset($comment_type) )
|
||||||
$comment_type = '';
|
$comment_type = '';
|
||||||
|
|
||||||
$result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->comments
|
$result = $wpdb->query( $wpdb->prepare("INSERT INTO $wpdb->comments
|
||||||
(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)
|
(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)
|
||||||
VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %d, %d)",
|
VALUES (%d, %s, %s, %s, %s, %s, %s, %s, %d, %s, %s, %s, %d, %d)",
|
||||||
$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) );
|
$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) );
|
||||||
|
|
||||||
$id = (int) $wpdb->insert_id;
|
$id = (int) $wpdb->insert_id;
|
||||||
|
|
||||||
@ -1099,6 +1101,7 @@ function wp_update_comment($commentarr) {
|
|||||||
comment_author = %s,
|
comment_author = %s,
|
||||||
comment_author_email = %s,
|
comment_author_email = %s,
|
||||||
comment_approved = %s,
|
comment_approved = %s,
|
||||||
|
comment_karma = %d,
|
||||||
comment_author_url = %s,
|
comment_author_url = %s,
|
||||||
comment_date = %s,
|
comment_date = %s,
|
||||||
comment_date_gmt = %s
|
comment_date_gmt = %s
|
||||||
@ -1107,6 +1110,7 @@ function wp_update_comment($commentarr) {
|
|||||||
$comment_author,
|
$comment_author,
|
||||||
$comment_author_email,
|
$comment_author_email,
|
||||||
$comment_approved,
|
$comment_approved,
|
||||||
|
$comment_karma,
|
||||||
$comment_author_url,
|
$comment_author_url,
|
||||||
$comment_date,
|
$comment_date,
|
||||||
$comment_date_gmt,
|
$comment_date_gmt,
|
||||||
|
Loading…
Reference in New Issue
Block a user