From bdeba45d760c7bf6ed24c99318b85bd4ad234b13 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:08:37 -0400 Subject: [PATCH 01/11] Revision submission in Classic displays "Undefined" link Fixes #653 --- admin/rvy_revision-classic-edit.dev.js | 5 ----- admin/rvy_revision-classic-edit.js | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/admin/rvy_revision-classic-edit.dev.js b/admin/rvy_revision-classic-edit.dev.js index 00353b7b..e5c40917 100644 --- a/admin/rvy_revision-classic-edit.dev.js +++ b/admin/rvy_revision-classic-edit.dev.js @@ -35,10 +35,6 @@ jQuery(document).ready( function($) { + ' ' + rvyObjEdit[rvyObjEdit.currentStatus + 'CompletedLinkCaption'] + '' - - + ' ' - + rvyObjEdit[rvyObjEdit.currentStatus + 'CompletedEditLinkCaption'] + '' - + '' + '

' @@ -97,7 +93,6 @@ jQuery(document).ready( function($) { $('#post-status-display').html(rvyObjEdit[rvyObjEdit.currentStatus + 'StatusCaption']); $('a.revision-preview').attr('href', rvyObjEdit[rvyObjEdit.currentStatus + 'CompletedURL']).show(); - $('a.revision-edit').attr('href', rvyObjEdit[rvyObjEdit.currentStatus + 'CompletedEditURL']).show(); } var revisionaryCreateError = function (data, txtStatus) { diff --git a/admin/rvy_revision-classic-edit.js b/admin/rvy_revision-classic-edit.js index 362a1cda..bd5efce3 100644 --- a/admin/rvy_revision-classic-edit.js +++ b/admin/rvy_revision-classic-edit.js @@ -8,8 +8,6 @@ if(rvyObjEdit[rvyObjEdit.currentStatus+'ActionCaption']){$(refSelector).after('< +rvyObjEdit[rvyObjEdit.currentStatus+'CompletedCaption']+' ' +' ' +rvyObjEdit[rvyObjEdit.currentStatus+'CompletedLinkCaption']+'' -+' ' -+rvyObjEdit[rvyObjEdit.currentStatus+'CompletedEditLinkCaption']+'' +'' +'

');} $('.edit-post-post-schedule__toggle').after('');if(rvyObjEdit[rvyObjEdit.currentStatus+'DeletionURL']){$('a.submitdelete').attr('href',rvyObjEdit[rvyObjEdit.currentStatus+'DeletionURL']);} @@ -17,6 +15,6 @@ $('#publish').hide();$('#save-post').val(rvyObjEdit.updateCaption);if(rvyObjEdit var RvyUIInterval=setInterval(RvySubmissionUI,100);$(document).on('click','a.save-timestamp, a.cancel-timestamp',function(){wp.autosave.server.triggerSave();});function RvyGetRandomInt(max){return Math.floor(Math.random()*max);} $(document).on('click','div.postbox-container',function(){$('a.revision-approve').attr('disabled','disabled');});$(document).on('click','a.revision-approve',function(){if($('a.revision-approve').attr('disabled')){return;} $('a.revision-approve').attr('disabled','disabled');if(wp.autosave.server.postChanged()){wp.autosave.server.triggerSave();var approvalDelay=250;}else{var approvalDelay=1;} -if(!rvyObjEdit[rvyObjEdit.currentStatus+'ActionURL']){var revisionaryCreateDone=function(){$('a.revision-approve').hide();$('.revision-created-wrapper, .revision-created').show();rvyObjEdit.currentStatus='pending';$('#post-status-display').html(rvyObjEdit[rvyObjEdit.currentStatus+'StatusCaption']);$('a.revision-preview').attr('href',rvyObjEdit[rvyObjEdit.currentStatus+'CompletedURL']).show();$('a.revision-edit').attr('href',rvyObjEdit[rvyObjEdit.currentStatus+'CompletedEditURL']).show();} +if(!rvyObjEdit[rvyObjEdit.currentStatus+'ActionURL']){var revisionaryCreateDone=function(){$('a.revision-approve').hide();$('.revision-created-wrapper, .revision-created').show();rvyObjEdit.currentStatus='pending';$('#post-status-display').html(rvyObjEdit[rvyObjEdit.currentStatus+'StatusCaption']);$('a.revision-preview').attr('href',rvyObjEdit[rvyObjEdit.currentStatus+'CompletedURL']).show();} var revisionaryCreateError=function(data,txtStatus){$('div.rvy-creation-ui').html(rvyObjEdit[rvyObjEdit.currentStatus+'ErrorCaption']);} var tmoSubmit=setInterval(function(){if(!wp.autosave.server.postChanged()){var data={'rvy_ajax_field':rvyObjEdit[rvyObjEdit.currentStatus+'AjaxField'],'rvy_ajax_value':rvyObjEdit.postID,'nc':RvyGetRandomInt(99999999)};$.ajax({url:rvyObjEdit.ajaxurl,data:data,dataType:"html",success:revisionaryCreateDone,error:revisionaryCreateError});clearInterval(tmoSubmit);}},approvalDelay);}else{var tmoApproval=setInterval(function(){if(!wp.autosave.server.postChanged()){window.location=rvyObjEdit[rvyObjEdit.currentStatus+'ActionURL'];clearInterval(tmoApproval);}},approvalDelay);return false;}});$(document).on('click','#post-body-content *, #content_ifr *, #wp-content-editor-container *, #tinymce *, #submitpost, span.revision-created',function(){$('.revision-created-wrapper, .revision-created').hide();$('a.revision-approve').html(rvyObjEdit[rvyObjEdit.currentStatus+'ActionCaption']).show().removeAttr('disabled');});}); \ No newline at end of file From 246cf8c441eb903c3304e860a1fc30af1d81102e Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:11:18 -0400 Subject: [PATCH 02/11] New revisions created with "Auto-submit" option have wrong date Fixes #655 --- revision-creation_rvy.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/revision-creation_rvy.php b/revision-creation_rvy.php index ffd92537..e54a3f76 100644 --- a/revision-creation_rvy.php +++ b/revision-creation_rvy.php @@ -171,7 +171,11 @@ private function insert_revision($data, $base_post_id, $revision_status, $args = return new \WP_Error(__( 'Could not insert revision into the database', 'revisionary')); } - $wpdb->update($wpdb->posts, ['comment_count' => $base_post_id], ['ID' => $revision_id]); + $update_data = ('pending-revision' == $data['post_mime_type']) // + ? ['comment_count' => $base_post_id, 'post_modified_gmt' => $data['post_modified_gmt'], 'post_modified' => $data['post_modified']] + : ['comment_count' => $base_post_id]; + + $wpdb->update($wpdb->posts, $update_data, ['ID' => $revision_id]); // Use the newly generated $post_ID. $where = array( 'ID' => $revision_id ); From b6f3bb40d0e1e4c7fcb7727bd513953e410902e6 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:14:53 -0400 Subject: [PATCH 03/11] Scheduled revisions not included in dashboard Publishing Soon list Fixes #657 --- admin/admin-dashboard_rvy.php | 7 +++++++ admin/admin_rvy.php | 3 +++ revisionary_main.php | 5 +++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/admin/admin-dashboard_rvy.php b/admin/admin-dashboard_rvy.php index e39e7d26..055bac6d 100644 --- a/admin/admin-dashboard_rvy.php +++ b/admin/admin-dashboard_rvy.php @@ -1,5 +1,8 @@ posts.post_type = 'post'", "$wpdb->posts.post_type IN ('$post_types_csv')", $clauses['where'] ); + $clauses['where'] = str_replace( "$wpdb->posts.post_status = 'future'", "($wpdb->posts.post_status = 'future' OR ($wpdb->posts.post_status = 'pending' AND $wpdb->posts.post_mime_type = 'future-revision'))", $clauses['where'] ); + + $revisionary->is_revisions_query = false; + remove_filter('posts_clauses_request', [&$this, 'fltDashboardQueryClauses']); return $clauses; } diff --git a/admin/admin_rvy.php b/admin/admin_rvy.php index a76ce4cd..cd3bec92 100644 --- a/admin/admin_rvy.php +++ b/admin/admin_rvy.php @@ -211,6 +211,9 @@ function limitRevisionEditorUI() { function flt_dashboard_recent_posts_query_args($query_args) { if ('future' == $query_args['post_status']) { + global $revisionary; + $revisionary->is_revisions_query = true; + require_once(dirname(__FILE__).'/admin-dashboard_rvy.php'); $rvy_dash = new RevisionaryDashboard(); $query_args = $rvy_dash->recentPostsQueryArgs($query_args); diff --git a/revisionary_main.php b/revisionary_main.php index 5bb36c8f..391e7aaf 100644 --- a/revisionary_main.php +++ b/revisionary_main.php @@ -16,6 +16,7 @@ class Revisionary var $rest = ''; // object ref - Revisionary_REST var $internal_meta_update = false; var $skip_filtering = false; + var $is_revisions_query = false; var $config_loaded = false; // configuration related to post types and statuses must be loaded late on the init action var $enabled_post_types = []; // enabled_post_types property is set (keyed by post type slug) late on the init action. @@ -235,7 +236,7 @@ function configurationLateInit() { } public function fltPostsClauses($clauses, $_wp_query, $args = []) { - global $wpdb; + global $wpdb, $revisionary; $defaults = [ 'is_revisions_query' => false, @@ -247,7 +248,7 @@ public function fltPostsClauses($clauses, $_wp_query, $args = []) { $$var = $args[$var]; } - if ($is_revisions_query || !empty($_wp_query->is_revisions_query) || !empty($_wp_query->query['is_revisions_query']) || $_wp_query->is_preview) { + if ($is_revisions_query || !empty($_wp_query->is_revisions_query) || !empty($_wp_query->query['is_revisions_query']) || (!empty($revisionary) && !empty($revisionary->is_revisions_query)) || $_wp_query->is_preview) { return $clauses; } From 4835d17c41861011bdb45053190dc51a98b6457d Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:17:54 -0400 Subject: [PATCH 04/11] Pro: Divi - Classic Editor setting did not trigger correct Revisions UI Fixes #659 --- utils.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils.php b/utils.php index 73c1b663..5b8f8113 100644 --- a/utils.php +++ b/utils.php @@ -97,6 +97,11 @@ public static function isBlockEditorActive() { remove_filter('use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2); } + // Divi: Classic Editor option + if (function_exists('et_get_option') && ( 'on' == et_get_option( 'et_enable_classic_editor', 'off' ))) { + return false; + } + // phpcs:ignore WordPress.VIP.SuperGlobalInputUsage.AccessDetected, WordPress.Security.NonceVerification.NoNonceVerification $conditions[] = (self::isWp5() || $pluginsState['gutenberg']) && ! $pluginsState['classic-editor'] From 2b4ee0cf3959fe5b4836014675ffd4c791bb54c2 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:19:58 -0400 Subject: [PATCH 05/11] Pro: Divi - Revision preview bar not visible on front end Fixes #661 --- front_rvy.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/front_rvy.php b/front_rvy.php index c3d2f87e..d0e27301 100644 --- a/front_rvy.php +++ b/front_rvy.php @@ -428,7 +428,11 @@ function rvyPreviewJS() { rvyAdminBarMenuZindex = barZ; } } else { + if (!empty($_REQUEST['et_fb']) && !defined('PP_REVISIONS_DIVI_NO_ADMIN_BAR') && function_exists('et_divi_replace_parent_stylesheet') && (!defined('ET_BUILDER_PRODUCT_VERSION') || version_compare(ET_BUILDER_PRODUCT_VERSION, '4.14.8', '<='))) { + var rvyAdminBarHeight = '32px'; + } else { var rvyAdminBarHeight = 0; + } } $('div.rvy_view_revision').css('position', 'fixed').css('top', '32px'); From ebaa578ee40644fd42f929d2bb0e268819b499ea Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:23:23 -0400 Subject: [PATCH 06/11] PHP warning on revision approval --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 7f36a296..1a0b160d 100644 --- a/functions.php +++ b/functions.php @@ -136,12 +136,12 @@ function revisionary_copy_postmeta($from_post, $to_post_id, $args = []) { $meta_keys = array_diff( $source_meta_keys, $meta_excludelist ); } - $target_meta_keys = \get_post_custom_keys( $to_post_id ); + $target_meta_keys = (array) \get_post_custom_keys( $to_post_id ); $meta_keys = apply_filters('revisionary_create_revision_meta_keys', $meta_keys); foreach ( $meta_keys as $meta_key ) { - if ($empty_target_only) { + if ($empty_target_only && !empty($target_meta_keys) && is_array($target_meta_keys)) { if (in_array($meta_key, $target_meta_keys)) { continue; } From 222b9b9805d78752e7d0f3561ff6d1746f6e16da Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:24:02 -0400 Subject: [PATCH 07/11] Support filtering of update_post_date setting --- admin/revision-action_rvy.php | 12 ++++++------ rvy_init.php | 4 ++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/admin/revision-action_rvy.php b/admin/revision-action_rvy.php index 0198f9d5..d1fbf1e6 100644 --- a/admin/revision-action_rvy.php +++ b/admin/revision-action_rvy.php @@ -586,8 +586,8 @@ function rvy_apply_revision( $revision_id, $actual_revision_status = '' ) { ); if ( - (in_array($revision->post_mime_type, ['pending-revision', 'draft-revision']) && !rvy_get_option('pending_revision_update_post_date')) - || (('future-revision' == $revision->post_mime_type) && !rvy_get_option('scheduled_revision_update_post_date')) + (in_array($revision->post_mime_type, ['pending-revision', 'draft-revision']) && !rvy_filter_option('pending_revision_update_post_date', ['revision_id' => $revision_id, 'post_id' => $published->ID])) + || (('future-revision' == $revision->post_mime_type) && !rvy_filter_option('scheduled_revision_update_post_date', ['revision_id' => $revision_id, 'post_id' => $published->ID])) ) { // @todo: how was post_date_gmt of published post previously set to zero? if (('0000-00-00 00:00:00' == $published->post_date_gmt) && ('0000-00-00 00:00:00' != $published->post_date)) { @@ -660,8 +660,8 @@ function rvy_apply_revision( $revision_id, $actual_revision_status = '' ) { } if ( - (in_array($revision->post_mime_type, ['draft-revision', 'pending-revision']) && rvy_get_option('pending_revision_update_modified_date')) - || (('future-revision' == $revision->post_mime_type) && rvy_get_option('scheduled_revision_update_modified_date')) + (in_array($revision->post_mime_type, ['draft-revision', 'pending-revision']) && rvy_filter_option('pending_revision_update_modified_date', ['revision_id' => $revision_id, 'post_id' => $published->ID])) + || (('future-revision' == $revision->post_mime_type) && rvy_filter_option('scheduled_revision_update_modified_date', ['revision_id' => $revision_id, 'post_id' => $published->ID])) ) { $post_modified = current_time('mysql'); $post_modified_gmt = current_time('mysql', 1); @@ -674,8 +674,8 @@ function rvy_apply_revision( $revision_id, $actual_revision_status = '' ) { $update_fields['post_modified_gmt'] = $post_modified_gmt; if ( - (in_array($revision->post_mime_type, ['draft-revision', 'pending-revision']) && rvy_get_option('pending_revision_update_post_date')) - || (('future-revision' == $revision->post_mime_type) && rvy_get_option('scheduled_revision_update_post_date')) + (in_array($revision->post_mime_type, ['draft-revision', 'pending-revision']) && rvy_filter_option('pending_revision_update_post_date', ['revision_id' => $revision_id, 'post_id' => $published->ID])) + || (('future-revision' == $revision->post_mime_type) && rvy_filter_option('scheduled_revision_update_post_date', ['revision_id' => $revision_id, 'post_id' => $published->ID])) ) { $update_fields['post_date'] = $post_modified; $update_fields['post_date_gmt'] = $post_modified_gmt; diff --git a/rvy_init.php b/rvy_init.php index 661867ce..c09cc400 100644 --- a/rvy_init.php +++ b/rvy_init.php @@ -897,6 +897,10 @@ function rvy_retrieve_options( $sitewide = false ) { } } +function rvy_filter_option($option_basename, $args) { + return apply_filters("pp_revisions_option_{$option_basename}", rvy_get_option($option_basename), $args); +} + function rvy_get_option($option_basename, $sitewide = -1, $get_default = false) { if (('async_scheduled_publish' == $option_basename) && function_exists('relevanssi_query')) { return false; From 55082bb4497a78e8dd2f75a686b4f9428b138ba3 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:24:23 -0400 Subject: [PATCH 08/11] Classic Editor element selection fix --- admin/rvy_revision-classic-edit.dev.js | 4 ++++ admin/rvy_revision-classic-edit.js | 1 + 2 files changed, 5 insertions(+) diff --git a/admin/rvy_revision-classic-edit.dev.js b/admin/rvy_revision-classic-edit.dev.js index e5c40917..b97d3b9a 100644 --- a/admin/rvy_revision-classic-edit.dev.js +++ b/admin/rvy_revision-classic-edit.dev.js @@ -13,6 +13,10 @@ jQuery(document).ready( function($) { var refSelector = 'div.misc-pub-section-last'; } + if (!$(refSelector).length) { + var refSelector = 'div.misc-pub-curtime'; + } + if (rvyObjEdit.ajaxurl && !$('div.rvy-creation-ui').length && $(refSelector).length) { $('#post-status-display').html(rvyObjEdit[rvyObjEdit.currentStatus + 'StatusCaption']); diff --git a/admin/rvy_revision-classic-edit.js b/admin/rvy_revision-classic-edit.js index bd5efce3..ec7237db 100644 --- a/admin/rvy_revision-classic-edit.js +++ b/admin/rvy_revision-classic-edit.js @@ -1,4 +1,5 @@ jQuery(document).ready(function($){var RvySubmissionUI=function(){var refSelector='#rvy_compare_button';if(!$(refSelector).length){var refSelector='div.misc-pub-section-last';} +if(!$(refSelector).length){var refSelector='div.misc-pub-curtime';} if(rvyObjEdit.ajaxurl&&!$('div.rvy-creation-ui').length&&$(refSelector).length){$('#post-status-display').html(rvyObjEdit[rvyObjEdit.currentStatus+'StatusCaption']);if(rvyObjEdit[rvyObjEdit.currentStatus+'ActionURL']){var url=rvyObjEdit[rvyObjEdit.currentStatus+'ActionURL'];}else{var url='javascript:void(0)';} if(rvyObjEdit[rvyObjEdit.currentStatus+'ActionCaption']){$(refSelector).after('
' +'' From 13c8df56b31f978b0e0adb26333cde1e448a3460 Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:24:59 -0400 Subject: [PATCH 09/11] Release 3.0.13 --- readme.txt | 32 ++++++++++++++++++-------------- revisionary.php | 4 ++-- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/readme.txt b/readme.txt index 145484f8..5ea363dd 100644 --- a/readme.txt +++ b/readme.txt @@ -7,7 +7,7 @@ Tags: revision, submit changes, duplicate post, duplicate page, revisions, appro Requires at least: 4.9.7 Requires PHP: 5.6.20 Tested up to: 5.9 -Stable tag: 3.0.12 +Stable tag: 3.0.13 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -26,13 +26,11 @@ Your users can update posts using the normal WordPress editor, but their changes ## Submit Change Requests for Posts #### PublishPress Revisions allows your users to submit change requests for published posts. Your users can update posts using the normal WordPress editor, but their changes will not be published automatically. Instead, the changes are stored as a "pending revision" that can be approved or rejected. - [Click here to see how to submit revisions](https://publishpress.com/knowledge-base/revisions-start/). ## Schedule Future Updates to Posts ## PublishPress Revisions allows you to schedule WordPress revisions to be published in the future. When you're editing a published post, all you need to do is select a future date and click "Schedule Revision". Your changes will be published at the specified time. - [Click here to see how to schedule revisions](https://publishpress.com/knowledge-base/schedule-revisions-future/). ## Manage and Moderate Changes to Content ## @@ -43,19 +41,16 @@ After you create a revision with PublishPress Revisions, you can find that revis ## Compare Current and Former Versions ## Pending and Scheduled Revisions can include changes to post content, categories, tags, featured image, page parent and other options. Each of these changes can be reviewed in the familiar Compare Revisions interface. - [Click here to see how to compare revisions](https://publishpress.com/knowledge-base/compare-revisions/). ## Frontend Moderation of Content Changes ## It is possible to preview and moderate revisions via the frontend of your WordPress site. If you click Preview for a pending revision, you'll see a toolbar across the frontend of the site. This toolbar will change color so you can easily know the status of the revision. For example, if you're looking at a pending revision, the toolbar will be green. For scheduled revisions, the toolbar will be grey. - [Click here to see how to manage from the frontend of your site](https://publishpress.com/knowledge-base/publishing-revisions-frontend/). ## Email Notifications for Revisions ## PublishPress Revisions will notify Administrators and Editors when a new revision is submitted. They can log in to preview, compare and approve the changes. PublishPress Revisions can also send emails for revision approval and publication. The Settings screen lets you disable unwanted notifications. - [Click here for more on revision notifications](https://publishpress.com/knowledge-base/emails-revisionary/). ## Additional Plugins Supported in the Pro Version ## @@ -88,7 +83,6 @@ PublishPress Revisions works with the default WordPress user roles, and also int To schedule changes to a published post, just set the desired future date before hitting Update. By upgrading to Revisions Pro, you also gain advanced permissions control through the PublishPress Permissions Pro plugin. You can customize permissions by role or per-user, granting full editing or revision submission rights to specific posts, categories, or taxonomy terms. - [Click here for more on revision permissions](https://publishpress.com/knowledge-base/permissions-revisions). ## Join PublishPress and get the Pro plugins ## @@ -237,6 +231,16 @@ Divi is one of the most popular page-builders in WordPress, and it does integrat == Changelog == += 3.0.13 - 17 Mar 2022 = +* Fixed : Revision submission in Classic Editor caused "Undefined" link next to "Preview" link +* Fixed : New revisions created with "Auto-submit" option had wrong date (and listing order) in Revision Queue +* Fixed : PHP error on revision approval under some configurations +* Fixed : Dashboard Activity widget: Scheduled revisions were not included in Publishing Soon list +* Compat : Divi - Revision preview bar not visible on front end +* Compat : Divi - Classic Editor setting did not trigger correct Revisions UI +* Compat : Custom post types - revision submission button not displayed in some configurations +* API: New filters pp_revisions_option_pending_revision_update_post_date, ​pp_revisions_option_pending_revision_update_modified_date, ​pp_revisions_option_scheduled_revision_update_post_date​, ​pp_revisions_option_scheduled_revision_update_modified_date + = 3.0.12 - 3 Mar 2022 = * Feature : Edit link in post editor after revision creation / scheduling * Change : Option to auto-submit revisions created by users who can publish the main post @@ -312,11 +316,11 @@ Divi is one of the most popular page-builders in WordPress, and it does integrat * API: Allow redirect to be disabled on revision creation = 3.0 - 9 Nov 2021 = -* Feature: New revision submission mechanism: create an unsubmitted revision first instead of editing existing post. Edit revision directly, then submit for scheduling or publication. -* Change: Revisions UI in Post / Revision editor -* Feature: Admin Bar includes "New Revision" button -* Change: Revision Queue filter captions -* Compat: Permissions - revise_others_posts, revise_others_pages, etc. capabilties are equivalent to list_others capabilities in allowing uneditable items to be listed +* Feature : New revision submission mechanism: create an unsubmitted revision first instead of editing existing post. Edit revision directly, then submit for scheduling or publication. +* Change : Revisions UI in Post / Revision editor +* Feature : Admin Bar includes "New Revision" button +* Change : Revision Queue filter captions +* Compat : Permissions - revise_others_posts, revise_others_pages, etc. capabilties are equivalent to list_others capabilities in allowing uneditable items to be listed * Change : Include upload_files capability in the Revisor role = 2.6.3 - 11 Oct 2021 = @@ -575,7 +579,7 @@ Divi is one of the most popular page-builders in WordPress, and it does integrat * Lang : Correct textdomain on numerous translation calls * Lang : Improve translation string construction * Lang : Support translation of Revisor role name -* Lang: Updated language files +* Lang : Updated language files = 2.1.7 - 13 Jan 2020 = * Fixed : Excessive resource usage with some caching solutions @@ -644,7 +648,7 @@ Divi is one of the most popular page-builders in WordPress, and it does integrat * Fixed : Classic Editor - Invalid Revisions > Browse link displayed to Revisors * Compat : Classic Editor plugin - with "Allow users to switch editors" enabled, non-default editor did not have correct javascript loaded for Revisions * Compat : On themes that use a fixed position header, display preview top bar above header -* Compat : PressPermit Pro - revision preview could not be viewed by Contributors under some configurations +* Compat : PressPermit Pro - revision preview could not be viewed by Contributors under some configurations * Fixed : On standard Compare Revisions screen (for past revisions), Preview and Manage button links did not update with slider selection change * Fixed : Pending, Schedule Revision notification - invalid preview link in some emails * Fixed : Trashed revisions were not identified as revisions in Edit Posts listing diff --git a/revisionary.php b/revisionary.php index 71c25627..c1102f45 100644 --- a/revisionary.php +++ b/revisionary.php @@ -5,7 +5,7 @@ * Description: Maintain published content with teamwork and precision using the Revisions model to submit, approve and schedule changes. * Author: PublishPress * Author URI: https://publishpress.com - * Version: 3.0.12 + * Version: 3.0.13 * Text Domain: revisionary * Domain Path: /languages/ * Min WP Version: 4.9.7 @@ -36,7 +36,7 @@ // Temporary usage within this module only; avoids multiple instances of version string global $pp_revisions_version; -$pp_revisions_version = '3.0.12'; +$pp_revisions_version = '3.0.13'; if( basename(__FILE__) == basename(esc_url_raw($_SERVER['SCRIPT_FILENAME'])) ) die( 'This page cannot be called directly.' ); From 2d915bc65e9bcf57c8c6018d8dd6b5040e66719e Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Mon, 21 Mar 2022 14:34:46 -0400 Subject: [PATCH 10/11] API: Revision publication does not trigger "wp_after_insert_post" action Fixes #664 --- admin/revision-action_rvy.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/admin/revision-action_rvy.php b/admin/revision-action_rvy.php index d1fbf1e6..19478cc7 100644 --- a/admin/revision-action_rvy.php +++ b/admin/revision-action_rvy.php @@ -798,6 +798,10 @@ function rvy_apply_revision( $revision_id, $actual_revision_status = '' ) { unset(presspermit()->flags['ignore_save_post']); } } + + if (!defined('RVY_NO_AFTER_INSERT_ACTION') && !empty($_published)) { + do_action('wp_after_insert_post', $_published->ID, $_published, true, $published); + } } rvy_delete_past_revisions($revision_id); From c902734a241ce27725ee8302b252fe92517d229e Mon Sep 17 00:00:00 2001 From: Kevin Behrens <43488774+agapetry@users.noreply.github.com> Date: Mon, 21 Mar 2022 14:45:02 -0400 Subject: [PATCH 11/11] Update change log --- readme.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 5ea363dd..85f5eb2a 100644 --- a/readme.txt +++ b/readme.txt @@ -231,11 +231,12 @@ Divi is one of the most popular page-builders in WordPress, and it does integrat == Changelog == -= 3.0.13 - 17 Mar 2022 = += 3.0.13 - 21 Mar 2022 = * Fixed : Revision submission in Classic Editor caused "Undefined" link next to "Preview" link * Fixed : New revisions created with "Auto-submit" option had wrong date (and listing order) in Revision Queue * Fixed : PHP error on revision approval under some configurations * Fixed : Dashboard Activity widget: Scheduled revisions were not included in Publishing Soon list +* Fixed : API: wp_after_insert_post action was not applied at revision publication * Compat : Divi - Revision preview bar not visible on front end * Compat : Divi - Classic Editor setting did not trigger correct Revisions UI * Compat : Custom post types - revision submission button not displayed in some configurations