Syntax
deleteComment(commentId_or_mode [,pageId])
Description
Deletes a comment with the specified id, deletes the latest comment or deletes all comments from a given page.Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
commentId_or_mode | number or string | yes | Either the comment id (if we use the routine with only one parameter) or one of the next, otherwise: |
page ID | number | no | Page ID. Should be used only if the mode is "DELETE_LATEST" or "DELETE_ALL" |
Return type
number
The number of comments deleted.
Examples
Example 1
number pageId = 123456; CComment[] comments = getComments(pageId); for (CComment comment in comments) { deleteComment(comment.id); }
Example 2
deleteComment("DELETE_ALL", 11801);
See also