-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1174 from publishpress/release-3.5.7
Release 3.5.7
- Loading branch information
Showing
24 changed files
with
947 additions
and
611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
/** | ||
* @package PublishPress\Revisions\RevisionaryAdmin | ||
* @author PublishPress <[email protected]> | ||
* @copyright Copyright (c) 2023 PublishPress. All rights reserved. | ||
* @copyright Copyright (c) 2024 PublishPress. All rights reserved. | ||
* @license GPLv2 or later | ||
* @since 1.0.0 | ||
* | ||
|
@@ -344,6 +344,11 @@ function flt_plugin_action_links($links, $file) { | |
|
||
public function fltPublishPressCapsSection($section_caps) { | ||
$section_caps['PublishPress Revisions'] = ['edit_others_drafts', 'edit_others_revisions', 'list_others_revisions', 'manage_unsubmitted_revisions']; | ||
|
||
if (defined('PUBLISHPRESS_REVISIONS_PRO_VERSION') && rvy_get_option('revision_restore_require_cap')) { | ||
$section_caps['PublishPress Revisions'] []= 'restore_revisions'; | ||
} | ||
|
||
return $section_caps; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
/** | ||
* @package PublishPress\Revisions\RevisionaryAction | ||
* @author PublishPress <[email protected]> | ||
* @copyright Copyright (c) 2023 PublishPress. All rights reserved. | ||
* @copyright Copyright (c) 2024 PublishPress. All rights reserved. | ||
* @license GPLv2 or later | ||
* @since 1.0.0 | ||
*/ | ||
|
@@ -100,6 +100,10 @@ function rvy_revision_submit($revision_id = 0) { | |
if ( empty($status_obj->public) && empty($status_obj->private) ) { | ||
$wpdb->update($wpdb->posts, ['post_status' => 'pending', 'post_mime_type' => 'pending-revision'], ['ID' => $revision_id]); | ||
|
||
if (defined('REVISIONARY_LIMIT_IGNORE_UNSUBMITTED')) { | ||
rvy_update_post_meta($published_id, '_rvy_has_revisions', true); | ||
} | ||
|
||
clean_post_cache($revision_id); | ||
|
||
require_once( dirname(REVISIONARY_FILE).'/revision-workflow_rvy.php' ); | ||
|
@@ -342,6 +346,7 @@ function rvy_revision_approve($revision_id = 0, $args = []) { | |
clean_post_cache( $revision->ID ); | ||
} else { | ||
$_result = rvy_apply_revision($revision->ID, $revision->post_mime_type); | ||
|
||
if (!$_result || is_wp_error($_result)) { | ||
// Go ahead with the normal redirect because the revision may have been approved / published already. | ||
// If revision does not exist, preview's Not Found will prevent false impression of success. | ||
|
@@ -861,6 +866,8 @@ function rvy_apply_revision( $revision_id, $actual_revision_status = '' ) { | |
], | ||
['ID' => $revision_id] | ||
); | ||
|
||
Revisionary::applyRevisionLimit($published); | ||
} else { | ||
wp_delete_post($revision_id, true); | ||
} | ||
|
Oops, something went wrong.