Make WordPress Core


Ignore:
Timestamp:
09/03/2015 07:57:15 PM (11 years ago)
Author:
DrewAPicture
Message:

Docs: Add complete file, class, property, and method documentation for the new WP_Comment class, introduced in [33891].

It's important for new functionality, especially something as significant as a new class to have complete documentation upon initial commit – not after the fact.

See #32619.

File:
1 edited

Legend:

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

    r33891 r33893  
    11<?php
    2 
    3  /**
    4  * WordPress Comment class
     2/**
     3 * Comments API: WP_Comment object class
     4 *
     5 * @package WordPress
     6 * @subpackage Comments
     7 * @since 4.4.0
     8 */
     9
     10/**
     11 * Core class used to organize comments as instantiated objects with defined members.
    512 *
    613 * @since 4.4.0
    714 */
    815final class WP_Comment {
    9         /**
     16
     17        /**
     18         * Comment ID.
     19         *
     20         * @since 4.4.0
     21         * @access public
    1022         * @var int
    1123         */
    1224        public $comment_ID;
    13         /**
     25
     26        /**
     27         * ID of the post the comment is associated with.
     28         *
     29         * @since 4.4.0
     30         * @access public
    1431         * @var int
    1532         */
    1633        public $comment_post_ID = 0;
    17         /**
    18          * @var int
    19          */
    20         public $comment_author;
    21         /**
     34
     35        /**
     36         * Comment author ID.
     37         *
     38         * @since 4.4.0
     39         * @access public
     40         * @var string
     41         */
     42        public $comment_author = '';
     43
     44        /**
     45         * Comment author email address.
     46         *
     47         * @since 4.4.0
     48         * @access public
    2249         * @var string
    2350         */
    2451        public $comment_author_email = '';
    25         /**
     52
     53        /**
     54         * Comment author URL.
     55         *
     56         * @since 4.4.0
     57         * @access public
    2658         * @var string
    2759         */
    2860        public $comment_author_url = '';
    29         /**
     61
     62        /**
     63         * Comment author IP address (IPv4 format).
     64         *
     65         * @since 4.4.0
     66         * @access public
    3067         * @var string
    3168         */
    3269        public $comment_author_IP = '';
    33         /**
     70
     71        /**
     72         * Comment date in YYYY-MM-DD HH:MM:SS format.
     73         *
     74         * @since 4.4.0
     75         * @access public
    3476         * @var string
    3577         */
    3678        public $comment_date = '0000-00-00 00:00:00';
    37         /**
     79
     80        /**
     81         * Comment GMT date in YYYY-MM-DD HH::MM:SS format.
     82         *
     83         * @since 4.4.0
     84         * @access public
    3885         * @var string
    3986         */
    4087        public $comment_date_gmt = '0000-00-00 00:00:00';
    41         /**
     88
     89        /**
     90         * Comment content.
     91         *
     92         * @since 4.4.0
     93         * @access public
    4294         * @var string
    4395         */
    4496        public $comment_content;
    45         /**
     97
     98        /**
     99         * Comment karma count.
     100         *
     101         * @since 4.4.0
     102         * @access public
    46103         * @var int
    47104         */
    48105        public $comment_karma = 0;
    49         /**
     106
     107        /**
     108         * Comment approval status.
     109         *
     110         * @since 4.4.0
     111         * @access public
    50112         * @var string
    51113         */
    52114        public $comment_approved = '1';
    53         /**
     115
     116        /**
     117         * Comment author HTTP user agent.
     118         *
     119         * @since 4.4.0
     120         * @access public
    54121         * @var string
    55122         */
    56123        public $comment_agent = '';
    57         /**
     124
     125        /**
     126         * Comment type.
     127         *
     128         * @since 4.4.0
     129         * @access public
    58130         * @var string
    59131         */
    60132        public $comment_type = '';
    61         /**
     133
     134        /**
     135         * Parent comment ID.
     136         *
     137         * @since 4.4.0
     138         * @access public
    62139         * @var int
    63140         */
    64141        public $comment_parent = 0;
    65         /**
     142
     143        /**
     144         * Comment author ID.
     145         *
     146         * @since 4.4.0
     147         * @access public
    66148         * @var int
    67149         */
    … …  
    69151
    70152        /**
    71          * Retrieve WP_Comment instance.
    72          *
     153         * Retrieves a WP_Comment instance.
     154         *
     155         * @since 4.4.0
     156         * @access public
    73157         * @static
    74          * @access public
    75          *
    76          * @global wpdb $wpdb
     158         *
     159         * @global wpdb $wpdb WordPress database abstraction object.
    77160         *
    78161         * @param int $id Comment ID.
    79          * @return WP_Comment|false Comment object, false otherwise.
     162         * @return WP_Comment|false Comment object, otherwise false.
    80163         */
    81164        public static function get_instance( $id ) {
    … …  
    104187        /**
    105188         * Constructor.
     189         *
     190         * Populates properties with object vars.
     191         *
     192         * @since 4.4.0
     193         * @access public
    106194         *
    107195         * @param WP_Comment $comment Comment object.
    … …  
    113201        }
    114202
     203        /**
     204         * Convert object to array.
     205         *
     206         * @since 4.4.0
     207         * @access public
     208         *
     209         * @return array Object as array.
     210         */
    115211        public function to_array() {
    116212                return get_object_vars( $this );
Note: See TracChangeset for help on using the changeset viewer.