onCategoryDeleted( )


An event that is triggered when a category is deleted.

The onCategoryDeleted() event handler runs when a category is deleted. The received CategoryDeleted object contains event metadata.

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

Method Declaration
Copy
function wixBlog_onCategoryDeleted(event: CategoryDeleted): void;
Method Parameters
eventCategoryDeleted

Information about the category that was deleted.

An event that occurs when a category is deleted
JavaScript
// Place this code in the events.js file // of your site's Backend section. // Add the file if it doesn't exist. export function wixBlog_onCategoryDeleted(event) { const categoryId = event.metadata.entityId; const deletedCategoryTime = event.metadata.eventTime; console.log("Category deleted", event); } /* * { * "metadata":{ * "id":"68dbe814-7280-44ef-a9dc-d32243ad3990", * "entityId":"62ab47e67bb78adfe3e75199", * "eventTime":"2022-06-16T15:14:15.762Z", * "triggeredByAnonymizeRequest":false * } * } */
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?