Search.../

onPostUnliked( )

An event that is triggered when a post is unliked.

Description

The onPostUnliked() event handler runs when a post is unliked. The received PostUnlikedEvent object contains the postId of the unliked post.

Note: Backend events don't work when previewing your site.

Syntax

function wixBlog_onPostUnliked(event: PostUnlikedEvent): void

onPostUnliked Parameters

NAME
TYPE
DESCRIPTION
event
Optional
PostUnlikedEvent

Information about the unliked post.

Returns

This function does not return anything.

Return Type:

void

Was this helpful?

An event that occurs when a post is unliked

Copy Code
1export function wixBlog_onPostUnliked(event) {
2 const timeUnliked = event.metadata.eventTime;
3 const postIdUnliked = event.data.postId;
4 console.log('Post unliked', event);
5}
6
7
8/* Full event object:
9 *
10 * {
11 * "metadata":{
12 * "id": "",
13 * "entityId": "e65bd5d9-36ca-4388-8064-3d785d0f5460",
14 * "eventTime":"2022-06-16T15:22:49.242Z",
15 * "triggeredByAnonymizeRequest":false
16 * },
17 * "data":{
18 * "postId":"e65bd5d9-36ca-4388-8064-3d785d0f5460"
19 * }
20 * }
21 */