1.20.x node.module node_set_node_tempstore($item, $node_tempstore_id)

Store changes to a node or menu item in the temporary store.

@since 1.11.0

Parameters

Node $item: The node item to save into tempstore.

string $node_tempstore_id: The tempstore ID of the node being saved to the object cache.

File

modules/node/node.module, line 3834
The core module that allows content to be submitted to the site.

Code

function node_set_node_tempstore($item, $node_tempstore_id) {
  $item->locked = array(
    'uid' => $GLOBALS['user']->uid,
    'updated' => REQUEST_TIME,
  );
  // Keep previews for 24 hours.
  tempstore_set('node_tempstore', $node_tempstore_id, $item, REQUEST_TIME + 86400);
}