---
url: /hooks/actions/wpce-save-node.md
description: >-
  Action fired for each cloned node before document save, useful for node-level
  side effects and cleanup.
---

# `wpce_save_node`&#x20;

Fires for each Node in a WPCE Document when it's about to be saved.

## Parameters

1. `object $node`

   The node that is being saved. The object is a clone of the original node, so it can be modified without affecting the original document tree.

2. `WPCE\Document $document`

   The [`Document`](https://bitbucket.org/ownbit/ownbit-wpce/src/dev/plugin/includes/WPCE/Document.php) which contains the node.

## Example

```php
add_action('wpce_save_node', function (object $node, WPCE\Document $document) {
	// ...
}, 10, 2);
```

## Related

* [`wpce_before_save`](./wpce-before-save)
* [`wpce_after_save`](./wpce-after-save)
* [`wpce_load_node`](./wpce-load-node)

***

:::info
This hook existed since WPCE , but was only used internally. Since , it's now a public hook with a slightly adjusted signature.
:::
