wppaste
WordPress

WP_Comment

Since
4.4.0
Source
wp-includes/class-wp-comment.php:15
Core class used to organize comments as instantiated objects with defined members.

Compatibility

WordPress
since 4.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 18

$comment_IDstringpublic
Comment ID.
$comment_post_IDstringpublic
ID of the post the comment is associated with.
$comment_authorstringpublic
Comment author name.
$comment_author_emailstringpublic
Comment author email address.
$comment_author_urlstringpublic
Comment author URL.
$comment_author_IPstringpublic
Comment author IP address (IPv4 format).
$comment_datestringpublic
Comment date in YYYY-MM-DD HH:MM:SS format.
$comment_date_gmtstringpublic
Comment GMT date in YYYY-MM-DD HH::MM:SS format.
$comment_contentstringpublic
Comment content.
$comment_karmastringpublic
Comment karma count.
$comment_approvedstringpublic
Comment approval status.
$comment_agentstringpublic
Comment author HTTP user agent.
$comment_typestringpublic
Comment type.
$comment_parentstringpublic
Parent comment ID.
$user_idstringpublic
Comment author ID.
$childrenarrayprotected
Comment children.
$populated_childrenboolprotected
Whether children have been populated for this comment object.
$post_fieldsarrayprotected
Post fields.

Methods · 9

Source code

#[AllowDynamicProperties]final class WP_Comment { 	/**	 * Comment ID.	 *	 * A numeric string, for compatibility reasons.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_ID; 	/**	 * ID of the post the comment is associated with.	 *	 * A numeric string, for compatibility reasons.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_post_ID = 0; 	/**	 * Comment author name.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_author = ''; 	/**	 * Comment author email address.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_author_email = ''; 	/**	 * Comment author URL.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_author_url = ''; 	/**	 * Comment author IP address (IPv4 format).	 *	 * @since 4.4.0	 * @var string	 */	public $comment_author_IP = ''; 	/**	 * Comment date in YYYY-MM-DD HH:MM:SS format.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_date = '0000-00-00 00:00:00'; 	/**	 * Comment GMT date in YYYY-MM-DD HH::MM:SS format.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_date_gmt = '0000-00-00 00:00:00'; 	/**	 * Comment content.	 *	 * @since 4.4.0	 * @var string	 */	public $comment_content; 	/**

Changelog

Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/class-wp-comment.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.