> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: onPostUpdated(event: UpdatedPost)

# Method package: wixForumBackend

# Method menu location: wixForumBackend --> Events --> onPostUpdated

# Method Link: https://dev.wix.com/docs/velo/apis/wix-forum-backend/events/on-post-updated.md

# Method Description:

A backend event that fires when a forum post is updated.

The `onPostUpdated()` event handler runs when a an existing forum post in your site is updated.
 The received `UpdatedPost` object contains information about the post that was updated.

> **Note:** Backend events are **not** fired when previewing your site.



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## A backend event that occurs when a forum post of type DISCUSSION is updated

```javascript
// Place this code in a file named events.js
// in the Backend section of your code files.

export function wixForum_onPostUpdated(event) {
  const postId = event.postId;
  const posterId = event.post.ownerId;
}

/*  Full post object:
 *  {
 *    "_id": "5f88058be9b6b100175b154f",
 *    "categoryId":"5f88058be9b6b100175b154d",
 *    "_ownerId":"32cf071a-ck2f-450f-ad74-5a25db0b1b6g",
 *    "title": "My Updated Post Title",
 *    "plainContent": "This is the updated text of my post.",
 *    "pinned": "true",
 *    "commentingDisabled": "false",
 *    "commentCount": 4,
 *    "likeCount": 13,
 *    "viewCount": 76,
 *    "_createdDate": "2020-10-26T07:18:20.297Z",
 *    "_editedDate": "2020-11-04T12:27:05.592Z",
 *    "_lastActivityDate": "2020-11-04T12:27:05.592Z",
 *    "slug": "my-updated-post-title",
 *    "pageUrl": "/forum/category-name/my-updated-post-title",
 *    "postType": "DISCUSSION"
 *  }
 */
```

## A backend event that occurs when a forum post of type QUESTION is updated

```javascript
// Place this code in a file named events.js
// in the Backend section of your code files.

export function wixForum_onPostUpdated(event) {
  const postId = event.postId;
  const postPageUrl = event.post.pageUrl;
}

/*  Full post object:
 *  {
 *    "_id": "5f88058be9b6b100175b154c",
 *    "categoryId":"5f88058be9b6b100175b154a",
 *    "_ownerId":"32cf071a-ck2f-450f-ad74-5a25db0b1b6g",
 *    "title": "What topics should we discuss?",
 *    "plainContent": "Let us know what you think in the comments below and vote for the best answer.",
 *    "bestAnswerCommentId": "5f88058be9b6b100175b154i",
 *    "pinned": "true",
 *    "commentingDisabled": "false",
 *    "commentCount": 9,
 *    "likeCount": 18,
 *    "viewCount": 64,
 *    "_createdDate": "2020-10-26T07:18:20.297Z",
 *    "_editedDate": "2020-11-04T12:27:05.592Z",
 *    "_lastActivityDate": "2020-11-04T12:27:05.592Z",
 *    "slug": "what-topics-should-we-discus",
 *    "pageUrl": "/forum/category-name/what-topics-should-we-discuss",
 *    "postType": "QUESTION"
 *  }
 */
```

---