onCommentUnmarkedAsBest( )


A backend event that fires when a forum comment is unmarked as best.

The onCommentUnmarkedAsBest() event handler runs when an existing forum comment in your site is unmarked as best. The received UnmarkedAsBestComment object contains information about the comment that was unmarked as best.

Notes:

  • Only comments on posts with a postType of "QUESTION" can be marked and unmarked as best.

  • Backend events are not fired when previewing your site.

Method Declaration
Copy
function onCommentUnmarkedAsBest(event: UnmarkedAsBestComment): void;
Method Parameters
eventUnmarkedAsBestCommentRequired

Information about the forum comment that was unmarked as best.

A backend event that occurs when a forum comment is unmarked as best
JavaScript
// Place this code in a file named events.js // in the Backend section of your code files. export function wixForum_onCommentUnmarkedAsBest(event) { const unmarkedCommentId = event.commentId; console.log("Comment unmarked as best"); }
Did this help?

onCommentUnvoted( )


A backend event that fires when a vote is removed from a forum comment.

The onCommentUnvoted() event handler runs when a vote is removed from a forum comment. The received UnvotedComment object contains information about the comment that was unvoted.

Notes:

  • Only comments on posts with a postType of "QUESTION" can be voted on.

  • Backend events are not fired when previewing your site.

Method Declaration
Copy
Method Parameters
eventUnvotedCommentRequired

Information about the forum comment that was upvoted.

A backend event that occurs when a forum comment is upvoted
JavaScript
Did this help?

onCommentUpdated( )


A backend event that fires when a forum comment is updated.

The onCommentUpdated() event handler runs when a an existing forum comment in your site is updated. The received UpdatedComment object contains information about the comment that was updated.

Note: Backend events are not fired when previewing your site.

Method Declaration
Copy
Method Parameters
eventUpdatedCommentRequired

Information about the forum comment that was updated.

A backend event that occurs when a forum comment is updated
JavaScript
Did this help?

onCommentUpvoted( )


A backend event that fires when a forum comment is upvoted.

The onCommentUpvoted() event handler runs when an existing forum comment in your site is upvoted. The received UpvotedComment object contains information about the comment that was upvoted.

Notes:

  • Only comments on posts with a postType of "QUESTION" can be upvoted.

  • Backend events are not fired when previewing your site.

Method Declaration
Copy
Method Parameters
eventUpvotedCommentRequired

Information about the forum comment that was upvoted.

A backend event that occurs when a forum comment is upvoted
JavaScript
Did this help?

onPostClosed( )


A backend event that fires when a forum post is closed.

The onPostClosed() event handler runs when an existing forum post in your site is closed. When a forum post is closed, members can't comment on the post. The received ClosedPost object contains information about the post that was closed.

Notes:

  • By default, forum posts are open.

  • Backend events are not fired when previewing your site.

Method Declaration
Copy
Method Parameters
eventClosedPostRequired

Information about the forum post that was closed.

A backend event that occurs when a forum post is closed
JavaScript
Did this help?

onPostCreated( )


A backend event that fires when a new forum post is created.

The onPostCreated() event handler runs when a new forum post is created in your site. The received CreatedPost object contains information about the new post that was created.

Note: Backend events are not fired when previewing your site.

Method Declaration
Copy
Method Parameters
eventCreatedPostRequired

Information about the forum post that was created.

A backend event that occurs when a new forum post is created
JavaScript
Did this help?