Make WordPress Core

Changeset 32499


Ignore:
Timestamp:
05/13/2015 02:50:56 AM (10 years ago)
Author:
DrewAPicture
Message:

Document the default arguments for wp_insert_comment() as a hash notation.

Props lamosty, rachelbaker.
See #31747.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment.php

    r32461 r32499  
    20832083
    20842084/**
    2085  * Inserts a comment to the database.
    2086  *
    2087  * The available comment data key names are 'comment_author_IP', 'comment_date',
    2088  * 'comment_date_gmt', 'comment_parent', 'comment_approved', and 'user_id'.
     2085 * Inserts a comment into the database.
    20892086 *
    20902087 * @since 2.0.0
     
    20922089 * @global wpdb $wpdb WordPress database abstraction object.
    20932090 *
    2094  * @param array $commentdata Contains information on the comment.
     2091 * @param array $commentdata {
     2092 *     Array of arguments for inserting a new comment.
     2093 *
     2094 *     @type string     $comment_agent        The HTTP user agent of the `$comment_author` when
     2095 *                                            the comment was submitted. Default empty.
     2096 *     @type int|string $comment_approved     Whether the comment has been approved. Default 1.
     2097 *     @type string     $comment_author       The name of the author of the comment. Default empty.
     2098 *     @type string     $comment_author_email The email address of the `$comment_author`. Default empty.
     2099 *     @type string     $comment_author_IP    The IP address of the `$comment_author`. Default empty.
     2100 *     @type string     $comment_author_url   The URL address of the `$comment_author`. Default empty.
     2101 *     @type string     $comment_content      The content of the comment. Default empty.
     2102 *     @type string     $comment_date         The date the comment was submitted. To set the date
     2103 *                                            manually, `$comment_date_gmt` must also be specified.
     2104 *                                            Default is the current time.
     2105 *     @type string     $comment_date_gmt     The date the comment was submitted in the GMT timezone.
     2106 *                                            Default is `$comment_date` in the site's GMT timezone.
     2107 *     @type int        $comment_karma        The karma of the comment. Default 0.
     2108 *     @type int        $comment_parent       ID of this comment's parent, if any. Default 0.
     2109 *     @type int        $comment_post_ID      ID of the post that relates to the comment, if any.
     2110 *                                            Default empty.
     2111 *     @type string     $comment_type         Comment type. Default empty.
     2112 *     @type int        $user_id              ID of the user who submitted the comment. Default 0.
     2113 * }
    20952114 * @return int|bool The new comment's ID on success, false on failure.
    20962115 */
Note: See TracChangeset for help on using the changeset viewer.