Changeset 33893
- Timestamp:
- 09/03/2015 07:57:15 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-comment.php
r33891 r33893 1 1 <?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. 5 12 * 6 13 * @since 4.4.0 7 14 */ 8 15 final class WP_Comment { 9 /** 16 17 /** 18 * Comment ID. 19 * 20 * @since 4.4.0 21 * @access public 10 22 * @var int 11 23 */ 12 24 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 14 31 * @var int 15 32 */ 16 33 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 22 49 * @var string 23 50 */ 24 51 public $comment_author_email = ''; 25 /** 52 53 /** 54 * Comment author URL. 55 * 56 * @since 4.4.0 57 * @access public 26 58 * @var string 27 59 */ 28 60 public $comment_author_url = ''; 29 /** 61 62 /** 63 * Comment author IP address (IPv4 format). 64 * 65 * @since 4.4.0 66 * @access public 30 67 * @var string 31 68 */ 32 69 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 34 76 * @var string 35 77 */ 36 78 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 38 85 * @var string 39 86 */ 40 87 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 42 94 * @var string 43 95 */ 44 96 public $comment_content; 45 /** 97 98 /** 99 * Comment karma count. 100 * 101 * @since 4.4.0 102 * @access public 46 103 * @var int 47 104 */ 48 105 public $comment_karma = 0; 49 /** 106 107 /** 108 * Comment approval status. 109 * 110 * @since 4.4.0 111 * @access public 50 112 * @var string 51 113 */ 52 114 public $comment_approved = '1'; 53 /** 115 116 /** 117 * Comment author HTTP user agent. 118 * 119 * @since 4.4.0 120 * @access public 54 121 * @var string 55 122 */ 56 123 public $comment_agent = ''; 57 /** 124 125 /** 126 * Comment type. 127 * 128 * @since 4.4.0 129 * @access public 58 130 * @var string 59 131 */ 60 132 public $comment_type = ''; 61 /** 133 134 /** 135 * Parent comment ID. 136 * 137 * @since 4.4.0 138 * @access public 62 139 * @var int 63 140 */ 64 141 public $comment_parent = 0; 65 /** 142 143 /** 144 * Comment author ID. 145 * 146 * @since 4.4.0 147 * @access public 66 148 * @var int 67 149 */ … … 69 151 70 152 /** 71 * Retrieve WP_Comment instance. 72 * 153 * Retrieves a WP_Comment instance. 154 * 155 * @since 4.4.0 156 * @access public 73 157 * @static 74 * @access public 75 * 76 * @global wpdb $wpdb 158 * 159 * @global wpdb $wpdb WordPress database abstraction object. 77 160 * 78 161 * @param int $id Comment ID. 79 * @return WP_Comment|false Comment object, false otherwise.162 * @return WP_Comment|false Comment object, otherwise false. 80 163 */ 81 164 public static function get_instance( $id ) { … … 104 187 /** 105 188 * Constructor. 189 * 190 * Populates properties with object vars. 191 * 192 * @since 4.4.0 193 * @access public 106 194 * 107 195 * @param WP_Comment $comment Comment object. … … 113 201 } 114 202 203 /** 204 * Convert object to array. 205 * 206 * @since 4.4.0 207 * @access public 208 * 209 * @return array Object as array. 210 */ 115 211 public function to_array() { 116 212 return get_object_vars( $this );
Note: See TracChangeset
for help on using the changeset viewer.