Search.../

onPostClosed( )

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

Description

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.

Syntax

function onPostClosed(event: ClosedPost): void

onPostClosed Parameters

NAME
TYPE
DESCRIPTION
event
ClosedPost

Information about the forum post that was closed.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

A backend event that occurs when a forum post is closed

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_onPostClosed(event) {
5 const closedPostId = event.postId;
6 console.log("Post closed to comments");
7}