Skip to end of banner
Go to start of banner

getCommentById

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Syntax

getCommentById(id)

Description

Gets all the comment properties for a given id.

Parameters

Parameter name

Type

Required

Description

comment ID

numberyesId of the page comment

Return type

CComment

The comment representation with the following keys:

Key name

Description

id

Id of the page comment.

textComment text.
authorAuthor of the comment.
createdCreation date, as a string, can be assigned to a date variable.
updatedByUpdater, or an empty string if there is no updater.
updatedUpdated 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

  • No labels