From e853c467fdf2643ae3fca14b53e9bfaac5189fd8 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 25 Aug 2015 17:02:51 +0000 Subject: [PATCH] Docs: Document the default comment data arguments for `wp_new_comment()`. Props rachelbaker, DrewAPicture Fixes #32369. git-svn-id: https://develop.svn.wordpress.org/trunk@33730 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/comment.php | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php index 9841d58ae2..fe03f1be07 100644 --- a/src/wp-includes/comment.php +++ b/src/wp-includes/comment.php @@ -2326,8 +2326,25 @@ function wp_throttle_comment_flood($block, $time_lastcomment, $time_newcomment) * * @global wpdb $wpdb * - * @param array $commentdata Contains information on the comment. See wp_insert_comment() - * for information on accepted arguments. + * @param array $commentdata { + * Comment data. + * + * @type string $comment_author The name of the comment author. + * @type string $comment_author_email The comment author email address. + * @type string $comment_author_url The comment author URL. + * @type string $comment_content The content of the comment. + * @type string $comment_date The date the comment was submitted. Default is the current time. + * @type string $comment_date_gmt The date the comment was submitted in the GMT timezone. + * Default is `$comment_date` in the GMT timezone. + * @type int $comment_parent The ID of this comment's parent, if any. Default 0. + * @type int $comment_post_ID The ID of the post that relates to the comment. + * @type int $user_id The ID of the user who submitted the comment. Default 0. + * @type int $user_ID Kept for backward-compatibility. Use `$user_id` instead. + * @type string $comment_agent Comment author user agent. Default is the value of 'HTTP_USER_AGENT' + * in the `$_SERVER` superglobal sent in the original request. + * @type string $comment_author_IP Comment author IP address in IPv4 format. Default is the value of + * 'REMOTE_ADDR' in the `$_SERVER` superglobal sent in the original request. + * } * @return int|false The ID of the comment on success, false on failure. */ function wp_new_comment( $commentdata ) {