Skip to content

Commit

Permalink
Merge pull request #1209 from publishpress/release-3.5.8.1
Browse files Browse the repository at this point in the history
Release 3.5.8.1
  • Loading branch information
agapetry authored Apr 16, 2024
2 parents 6f8cad6 + 0bfdef1 commit 311f15a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tags: revision, submit changes, duplicate post, duplicate page, revisions, appro
Requires at least: 5.5
Requires PHP: 7.2.5
Tested up to: 6.5
Stable tag: 3.5.8
Stable tag: 3.5.8.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -239,7 +239,10 @@ Divi is one of the most popular page-builders in WordPress, and it does integrat

== Changelog ==

= 3.5.8 - 11 Apr 2024 =
= 3.5.8.1 - 16 Apr 2024 =
* Fixed : If limiting to one active revision per post, deleting a revision before saving it did not restore creation ability on some sites

= 3.5.8 - 12 Apr 2024 =
* Fixed : Revision Editor hid category selection checkboxes
* Fixed : New Revision button was missing from Revision Editor sidebar
* Fixed : Revision Editor did not display Preview Revision button
Expand Down
9 changes: 8 additions & 1 deletion revisionary_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,14 @@ function actDeletePost($post_id) {
)
);

revisionary_refresh_postmeta(rvy_post_id($post->ID), ['ignore_revisions' => [$post->ID]]);
$meta_args = ['ignore_revisions' => [$post->ID]];

if (rvy_get_option('revision_limit_per_post')) {
delete_post_meta(rvy_post_id($post->ID), '_rvy_has_revisions');
$meta_args['insert_only'] = true;
}

revisionary_refresh_postmeta(rvy_post_id($post->ID), $meta_args);
}
}

Expand Down
3 changes: 2 additions & 1 deletion rvy_init-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,8 @@ function revisionary_refresh_postmeta($post_id, $args = []) {

if ($set_value && (empty($_post) || empty($_post->post_mime_type) || !in_array($_post->post_mime_type, ['draft-revision', 'pending-revision', 'future-revision']))) {
rvy_update_post_meta($post_id, '_rvy_has_revisions', $set_value);
} else {

} elseif (empty($args['insert_only'])) { // avoid redundant deletions
delete_post_meta($post_id, '_rvy_has_revisions');
}
}
Expand Down

0 comments on commit 311f15a

Please sign in to comment.