Class that represent a wordpress comment
$comment = new \WPS\Comment($wp_comment);Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com
Construct the object using the passed wp_comment
| Name | Type | Description | Status | Default |
|---|---|---|---|---|
| $wp_comment | { WP_Comment } | The wordpress comment object to encapsulate | required |
$wpsComment = new \WPS\Comment($wp_comment);Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com
Public
The comment id
Type : { Integer }
Public
Default : null
The comment post id
Type : { Integer }
Public
Default : null
The comment author ip address
Type : { String }
Public
Default : null
The comment datetime
Type : { String }
Public
Default : null
The comment date GMT
Type : { String }
Public
Default : null
The comment content
Type : { String }
Public
Default : null
The comment karma
Type : { Integer }
Public
Default : null
The comment approved status
Type : { Integer }
Public
Default : null
The comment author user agent
Type : { String }
Public
Default : null
The comment type
Type : { String }
Public
Default : null
The comment parent id
Type : { Integer }
Public
Default : null
Properties accessor
Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com
Public
Get the post on which this comment has been published
Return { WPS_Post } A WPS_Post object representing the post on which the comment has been published
$post = $comment->post;Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com
Public
Get the user who post the comment
Return { WPS_User } A WPS_User object representing the user who post the comment
$author = $comment->author;Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com
Public
Check if the comment is approved or not
Return { Boolean } true if approved, false if not
Author : Olivier Bossel olivier.bossel@gmail.com https://olivierbossel.com
Public