WordPress.org

Make WordPress Core

Ticket #31747: docs_update.31747.diff

File docs_update.31747.diff, 2.5 KB (added by lamosty, 5 years ago)

Update docs of wp_insert_comment function

  • src/wp-includes/comment.php

    diff --git src/wp-includes/comment.php src/wp-includes/comment.php
    index 6fcb4a6..e102675 100644
    function wp_get_current_commenter() { 
    20822082/**
    20832083 * Inserts a comment to the database.
    20842084 *
    2085  * The available comment data key names are 'comment_author_IP', 'comment_date',
    2086  * 'comment_date_gmt', 'comment_parent', 'comment_approved', and 'user_id'.
     2085 * You can set the comment date manually, by setting the values for 'comment_date'
     2086 * and 'comment_date_gmt' keys.
    20872087 *
    20882088 * @since 2.0.0
    20892089 *
    20902090 * @global wpdb $wpdb WordPress database abstraction object.
    20912091 *
    2092  * @param array $commentdata Contains information on the comment.
     2092 * @param array $commentdata {
     2093 *     Contains information on the comment.
     2094 *
     2095 *     @type string     $comment_agent         The browser's user agent string of the user who added the comment.
     2096 *                                             Default empty.
     2097 *     @type int|string $comment_approved      Whether the comment has been approved or trashed. Default 1.
     2098 *     @type string     $comment_author        The nickname of the user who added the comment. Default empty.
     2099 *     @type string     $comment_author_email  The email of the user who added the comment. Default empty.
     2100 *     @type string     $comment_author_IP     The IP address of the user who added the comment. Default empty.
     2101 *     @type string     $comment_author_url    The URL address of the comment author website. Default empty.
     2102 *     @type string     $comment_content       The comment content. Default empty.
     2103 *     @type string     $comment_date          The date of the comment. Default is the current time.
     2104 *     @type string     $comment_date_gmt      The date of the comment in the GMT timezone. Default is
     2105 *                                             the value of `$comment_date` in the GMT timezone.
     2106 *     @type int        $comment_karma         The comment karma. Default 0.
     2107 *     @type int        $comment_parent        Set this for the comment it belongs to, if any. Default 0.
     2108 *     @type int|string $comment_post_ID       The ID of the post the comment belongs to, if any. Default empty.
     2109 *     @type string     $comment_type          The comment type. Default empty.
     2110 *     @type int        $user_id               The ID of the user who added the comment. Default 0.
     2111 * }
    20932112 * @return int|bool The new comment's ID on success, false on failure.
    20942113 */
    20952114function wp_insert_comment( $commentdata ) {