Skip to end of banner
Go to start of banner

deleteComment

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 6 Next »

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:
- "DELETE_LATEST" to delete the latest comment for the given page
- "DELETE_ALL" to delete all the comments for the given page

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.


Example

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

  • No labels