function _revisioning_revertpublish_revision in Revisioning 6.3
Same name and namespace in other branches
- 8 revisioning_api.inc \_revisioning_revertpublish_revision()
- 6.4 revisioning_api.inc \_revisioning_revertpublish_revision()
- 7 revisioning_api.inc \_revisioning_revertpublish_revision()
Revert node to selected revision without changing its publication status.
Parameters
$node: Target $node object (loaded with target revision) or nid of target node
$vid: Optional vid of revision to revert to, if provided $node must not be an object.
File
- ./
revisioning_api.inc, line 187 - API functions of Revisioning module
Code
function _revisioning_revertpublish_revision(&$node, $vid = NULL) {
$node_revision = is_object($node) ? $node : node_load($node, $vid);
$return = module_invoke_all('revisionapi', 'pre revert', $node_revision);
if (in_array(FALSE, $return)) {
drupal_goto('node/' . $node_revision->nid . '/revisions/' . $node_revision->vid . '/view');
die;
}
_revisioning_revert_revision($node_revision);
module_invoke_all('revisionapi', 'post revert', $node_revision);
}