Skip to content

Commit

Permalink
Merge pull request #564 from publishpress/release-3.0.4
Browse files Browse the repository at this point in the history
Release 3.0.4
  • Loading branch information
agapetry authored Nov 19, 2021
2 parents cf69ca2 + 71b36f2 commit 6d7a168
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 32 deletions.
6 changes: 3 additions & 3 deletions admin/class-list-table_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function revisions_where_filter($where, $args = []) {
$revision_status_csv = rvy_revision_statuses(['return' => 'csv']);

$own_revision_and = $this->append_revisions_where($where, $args);
$own_revision_clause = "OR ($p.post_status IN ('draft', 'pending') AND $p.post_mime_type IN ($revision_status_csv) AND $p.post_author = '$current_user->ID'{$own_revision_and})";
$own_revision_clause = " OR ($p.post_status IN ('draft', 'pending') AND $p.post_mime_type IN ($revision_status_csv) AND $p.post_author = '$current_user->ID'{$own_revision_and})";
} else {
$own_revision_clause = '';
}
Expand Down Expand Up @@ -311,7 +311,7 @@ function revisions_where_filter($where, $args = []) {
"SELECT ID FROM $wpdb->posts WHERE post_status IN ($status_csv) AND post_author = %d",
$current_user->ID
)
);
);

if (rvy_get_option('admin_revisions_to_own_posts')) {
$own_posts = apply_filters('revisionary_own_post_ids', $own_posts, $current_user->ID);
Expand Down Expand Up @@ -727,7 +727,7 @@ private function count_revisions($post_type = '', $statuses = '' ) {
}

$counts = (object) $counts;

return apply_filters( 'revisionary_count_revisions', $counts, $post_type, $statuses );
}

Expand Down
22 changes: 11 additions & 11 deletions admin/rvy_post-classic-edit.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jQuery(document).ready( function($) {
rvyCopyPost();
}
});

function rvyCopyPost() {
var revisionaryCreateDone = function () {
$('.revision-create').hide();
Expand All @@ -90,16 +90,16 @@ jQuery(document).ready( function($) {
$('div.rvy-creation-ui').html(rvyObjEdit.errorCaption);
}

var data = {'rvy_ajax_field': 'create_revision', 'rvy_ajax_value': rvyObjEdit.postID, 'rvy_date_selection': RvyTimeSelection, 'nc': RvyGetRandomInt(99999999)};
var data = {'rvy_ajax_field': 'create_revision', 'rvy_ajax_value': rvyObjEdit.postID, 'rvy_date_selection': RvyTimeSelection, 'nc': RvyGetRandomInt(99999999)};

$.ajax({
url: rvyObjEdit.ajaxurl,
data: data,
dataType: "html",
success: revisionaryCreateDone,
error: revisionaryCreateError
});
}
$.ajax({
url: rvyObjEdit.ajaxurl,
data: data,
dataType: "html",
success: revisionaryCreateDone,
error: revisionaryCreateError
});
}

$(document).on('click', '#normal-sortables input, #normal-sortables select', function() {
$('a.revision-create').attr('disabled', 'disabled');
Expand Down Expand Up @@ -210,7 +210,7 @@ jQuery(document).ready( function($) {
RvyTimeSelection = '';
}
}

$('#publish').val(rvyObjEdit.update);
$('#publish').show();
}
Expand Down
4 changes: 2 additions & 2 deletions admin/rvy_revision-block-edit.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ jQuery(document).ready( function($) {
$('button.editor-post-publish-button').show();

} else {
if ( $('button.editor-post-publish-button').length ) {
$('button.editor-post-publish-button').hide();
if ( $('button.editor-post-publish-button').length ) {
$('button.editor-post-publish-button').hide();
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions front_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ function act_template_redirect() {
)
. sprintf(
str_replace(' ', ' ',
apply_filters(
'revisionary_preview_compare_view_caption',
apply_filters(
'revisionary_preview_compare_view_caption',
__("%sCompare%s%sView Published Post%s", 'revisionary'),
$post // revision
$post // revision
)
),
"<span><a href='$diff_url' class='rvy_preview_linkspan' target='_revision_diff'>",
Expand All @@ -264,10 +264,10 @@ function act_template_redirect() {
$view_published = ($published_url)
? sprintf(
str_replace(' ', '&nbsp;',
apply_filters(
'revisionary_preview_view_caption',
apply_filters(
'revisionary_preview_view_caption',
__("%sView Published Post%s", 'revisionary'),
$post // revision
$post // revision
)
),
"<span><a href='$published_url' class='rvy_preview_linkspan'>",
Expand Down
6 changes: 5 additions & 1 deletion 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: 4.9.7
Requires PHP: 5.6.20
Tested up to: 5.8
Stable tag: 3.0.3
Stable tag: 3.0.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= 3.0.4 - 19 Nov 2021 =
* Fixed : New Revision button not displayed in Admin Bar
* Fixed : Revision Queue: revisions not listed in My Activity view

= 3.0.3 - 18 Nov 2021 =
* Fixed : Revisions Queue empty on sites with a large number of published posts
* Compat : WooCommerce - Hide Product Variations, Linked Products tabs when editing a Product Revision
Expand Down
4 changes: 2 additions & 2 deletions revisionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.3
* Version: 3.0.4
* Text Domain: revisionary
* Domain Path: /languages/
* Min WP Version: 4.9.7
Expand Down Expand Up @@ -37,7 +37,7 @@
// Temporary usage within this module only; avoids multiple instances of version string
global $pp_revisions_version;

$pp_revisions_version = '3.0.3';
$pp_revisions_version = '3.0.4';

if( basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME']) )
die( 'This page cannot be called directly.' );
Expand Down
8 changes: 4 additions & 4 deletions revisionary_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ function addFilters() {

add_action( 'deleted_post', [$this, 'actDeletedPost']);


if ( rvy_get_option('scheduled_revisions') ) {
// users who have edit_published capability for post/page can create a scheduled revision by modifying post date to a future date (without setting "future" status explicitly)
add_filter( 'wp_insert_post_data', array($this, 'flt_insert_post_data'), 99, 2 );
Expand Down Expand Up @@ -596,7 +595,7 @@ function fltStatusChangeCap($caps, $cap, $user_id, $args) {
}

if (!empty($type_obj)) {
if (rvy_get_option("copy_posts_capability")) {
if (rvy_get_option("copy_posts_capability")) {
$base_prop = (rvy_is_post_author($post_id)) ? 'edit_posts' : 'edit_others_posts';
$copy_cap_name = str_replace('edit_', 'copy_', $type_obj->cap->$base_prop);
$can_copy = current_user_can($copy_cap_name);
Expand Down Expand Up @@ -837,11 +836,11 @@ private function filter_caps($wp_blogcaps, $reqd_caps, $args, $internal_args = a
// Grant edit permission for revision if user can edit main post
if (!empty($args[0]) && ('edit_post' == $args[0]) && array_diff($reqd_caps, array_keys(array_filter($wp_blogcaps)))) {
$this->skip_filtering = true;

if (rvy_get_option('admin_revisions_to_own_posts') && current_user_can('edit_post', rvy_post_id($post_id))) {
$wp_blogcaps = array_merge($wp_blogcaps, array_fill_keys($reqd_caps, true));
}

$this->skip_filtering = false;
}
}
Expand Down Expand Up @@ -888,6 +887,7 @@ function flt_regulate_revision_status($data, $postarr) {

if (!rvy_is_revision_status($postarr['post_mime_type']) || !in_array($postarr['post_status'], rvy_revision_base_statuses())) {
$revert_status = true;

} elseif ($revision) {
if (($data['post_mime_type'] != $revision->post_mime_type) || ($data['post_status'] != $revision->post_status)
&& (('future-revision' == $revision->post_mime_type) || ('future-revision' == $postarr['post_mime_type']))
Expand Down
6 changes: 3 additions & 3 deletions rvy_init.php
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,10 @@ function rvy_update_option( $option_basename, $option_val, $sitewide = -1 ) {
$sitewide = isset( $rvy_options_sitewide ) && ! empty( $rvy_options_sitewide[$option_basename] );
}

if ( $sitewide ) {
update_site_option( "rvy_$option_basename", $option_val );
if ($sitewide) {
update_site_option("rvy_$option_basename", $option_val);
} else {
update_option( "rvy_$option_basename", $option_val );
update_option("rvy_$option_basename", $option_val);
}
}

Expand Down

0 comments on commit 6d7a168

Please sign in to comment.