Search.../

onCommentMarkedAsBest( )

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

Description

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

Notes:

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

  • Backend events are not fired when previewing your site.

Syntax

function onCommentMarkedAsBest(event: MarkedAsBestComment): void

onCommentMarkedAsBest Parameters

NAME
TYPE
DESCRIPTION
event
MarkedAsBestComment

Information about the forum comment that was marked as best.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

A backend event that occurs when a forum comment is marked as best

Copy Code
1// Place this code in a file named events.js
2// in the Backend section of your code files.
3
4export function wixForum_onCommentMarkedAsBest(event) {
5 const bestCommentId = event.commentId;
6 console.log("Comment marked as best");
7}