Search.../

onPostPinned( )

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

Description

The onPostPinned() event handler runs when an existing forum post in your site is pinned. Only forum admins can pin posts. The received PinnedPost object contains information about the post that was pinned.

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

Syntax

function onPostPinned(event: PinnedPost): void

onPostPinned Parameters

NAME
TYPE
DESCRIPTION
event
PinnedPost

Information about the forum post that was pinned.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

A backend event that occurs when a forum post is pinned

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_onPostPinned(event) {
5 const pinnedPostId = event.postId;
6 console.log("Post pinned");
7}