function _revisioning_revertpublish_revision in Revisioning 7
Same name and namespace in other branches
- 8 revisioning_api.inc \_revisioning_revertpublish_revision()
- 6.4 revisioning_api.inc \_revisioning_revertpublish_revision()
- 6.3 revisioning_api.inc \_revisioning_revertpublish_revision()
Revert node to selected revision without changing its publication status.
Parameters
object|int $node: Target $node object (loaded with target revision) or nid of target node
int $vid: (optional) vid of revision to revert to, if provided $node must not be an object.
File
- ./
revisioning_api.inc, line 338 - 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');
}
_revisioning_revert_revision($node_revision);
module_invoke_all('revisionapi', 'post revert', $node_revision);
}