From 4769bd2a4f70a8f3c0014f61ff64dabf6bec7c6b Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Wed, 13 May 2015 02:51:28 +0000 Subject: [PATCH] Document the default arguments for `wp_insert_comment()` as a hash notation. Props lamosty, rachelbaker. See #31747. Built from https://develop.svn.wordpress.org/trunk@32499 git-svn-id: http://core.svn.wordpress.org/trunk@32469 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/comment.php | 29 ++++++++++++++++++++++++----- wp-includes/version.php | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/wp-includes/comment.php b/wp-includes/comment.php index c5be35b13b..9f2fa19d73 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -2082,16 +2082,35 @@ function wp_get_current_commenter() { } /** - * Inserts a comment to the database. - * - * The available comment data key names are 'comment_author_IP', 'comment_date', - * 'comment_date_gmt', 'comment_parent', 'comment_approved', and 'user_id'. + * Inserts a comment into the database. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * - * @param array $commentdata Contains information on the comment. + * @param array $commentdata { + * Array of arguments for inserting a new comment. + * + * @type string $comment_agent The HTTP user agent of the `$comment_author` when + * the comment was submitted. Default empty. + * @type int|string $comment_approved Whether the comment has been approved. Default 1. + * @type string $comment_author The name of the author of the comment. Default empty. + * @type string $comment_author_email The email address of the `$comment_author`. Default empty. + * @type string $comment_author_IP The IP address of the `$comment_author`. Default empty. + * @type string $comment_author_url The URL address of the `$comment_author`. Default empty. + * @type string $comment_content The content of the comment. Default empty. + * @type string $comment_date The date the comment was submitted. To set the date + * manually, `$comment_date_gmt` must also be specified. + * 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 site's GMT timezone. + * @type int $comment_karma The karma of the comment. Default 0. + * @type int $comment_parent ID of this comment's parent, if any. Default 0. + * @type int $comment_post_ID ID of the post that relates to the comment, if any. + * Default empty. + * @type string $comment_type Comment type. Default empty. + * @type int $user_id ID of the user who submitted the comment. Default 0. + * } * @return int|bool The new comment's ID on success, false on failure. */ function wp_insert_comment( $commentdata ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index ff798d95fd..90c6681570 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32498'; +$wp_version = '4.3-alpha-32499'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.