Syntax
getCommentById(id)
Description
Gets all the comment properties for a given id.Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
comment ID | number | yes | Id of the page comment |
Return type
CComment
The comment representation with the following keys:
Key name | Description |
---|---|
id | Id of the page comment. |
text | Comment text. |
author | Author of the comment. |
created | Creation date, as a string, can be assigned to a date variable. |
updatedBy | Updater, or an empty string if there is no updater. |
updated | Updated date, or an empty string if there's no update. |
Example
Example 1
number [] allComm = getAllCommentIds(11801); interval year = "365d"; for(number c in allComm) { CComment comm = getCommentById(c); if(comm.created < (currentDate - year)) { deleteComment(c) } }
Deletes all comments older than 1 year from page ID 11801.
See also