Skip to content

Commit fc121d6

Browse files
authored
Merge pull request #145 from RRZE-Webteam/dev
Dev
2 parents f8ef4d8 + 95a6eb2 commit fc121d6

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cms-workflow.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/*
44
Plugin Name: CMS-Workflow
55
Plugin URI: https://github.com/RRZE-Webteam/cms-workflow
6-
Version: 2.0.6
6+
Version: 2.0.7
77
Description: Redaktioneller Workflow.
88
Author: RRZE-Webteam
99
Author URI: https://blogs.fau.de/webworking/

includes/Modules/Versioning/Versioning.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,8 @@ public function version_post_replace_on_publish($post_id, $post)
407407
}
408408

409409
// Update revision
410-
$latest_revision = array_shift(wp_get_post_revisions($version_post_id));
410+
$post_revisions = wp_get_post_revisions($version_post_id);
411+
$latest_revision = array_shift($post_revisions);
411412
wp_update_post(array(
412413
'ID' => $latest_revision->ID,
413414
'post_author' => $post->post_author
@@ -432,6 +433,10 @@ public function version_post_replace_on_publish($post_id, $post)
432433
return;
433434
}
434435

436+
if (defined('REST_REQUEST') && REST_REQUEST) {
437+
return;
438+
}
439+
435440
wp_safe_redirect(admin_url('post.php?post=' . $version_post_id . '&action=edit&message=1'));
436441
exit;
437442
}

0 commit comments

Comments
 (0)