Version Description
(2021-01-27) =
Bugfixes:
- Fixes a bug where editing posts with Elementor could trigger a fatal error.
Download this release
Release Info
Developer | lopo |
Plugin | Duplicate Post |
Version | 4.1.1 |
Comparing to | |
See all releases |
Code changes from version 4.1 to 4.1.1
- duplicate-post.php +2 -2
- js/dist/{duplicate-post-edit-410.js → duplicate-post-edit-411.js} +0 -0
- js/dist/{duplicate-post-elementor-410.js → duplicate-post-elementor-411.js} +1 -1
- js/dist/{duplicate-post-options-410.js → duplicate-post-options-411.js} +0 -0
- js/dist/{duplicate-post-quick-edit-410.js → duplicate-post-quick-edit-411.js} +0 -0
- js/dist/{duplicate-post-strings-410.js → duplicate-post-strings-411.js} +0 -0
- readme.txt +9 -3
- src/ui/class-block-editor.php +1 -1
duplicate-post.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Yoast Duplicate Post
|
4 |
* Plugin URI: https://yoast.com/wordpress/plugins/duplicate-post/
|
5 |
* Description: The go-to tool for cloning posts and pages, including the powerful Rewrite & Republish feature.
|
6 |
-
* Version: 4.1
|
7 |
* Author: Enrico Battocchi & Team Yoast
|
8 |
* Author URI: https://yoast.com
|
9 |
* Text Domain: duplicate-post
|
@@ -42,7 +42,7 @@ if ( ! defined( 'DUPLICATE_POST_PATH' ) ) {
|
|
42 |
define( 'DUPLICATE_POST_PATH', plugin_dir_path( __FILE__ ) );
|
43 |
}
|
44 |
|
45 |
-
define( 'DUPLICATE_POST_CURRENT_VERSION', '4.1' );
|
46 |
|
47 |
$duplicate_post_autoload_file = __DIR__ . '/vendor/autoload.php';
|
48 |
|
3 |
* Plugin Name: Yoast Duplicate Post
|
4 |
* Plugin URI: https://yoast.com/wordpress/plugins/duplicate-post/
|
5 |
* Description: The go-to tool for cloning posts and pages, including the powerful Rewrite & Republish feature.
|
6 |
+
* Version: 4.1.1
|
7 |
* Author: Enrico Battocchi & Team Yoast
|
8 |
* Author URI: https://yoast.com
|
9 |
* Text Domain: duplicate-post
|
42 |
define( 'DUPLICATE_POST_PATH', plugin_dir_path( __FILE__ ) );
|
43 |
}
|
44 |
|
45 |
+
define( 'DUPLICATE_POST_CURRENT_VERSION', '4.1.1' );
|
46 |
|
47 |
$duplicate_post_autoload_file = __DIR__ . '/vendor/autoload.php';
|
48 |
|
js/dist/{duplicate-post-edit-410.js → duplicate-post-edit-411.js}
RENAMED
File without changes
|
js/dist/{duplicate-post-elementor-410.js → duplicate-post-elementor-411.js}
RENAMED
@@ -1 +1 @@
|
|
1 |
-
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}({11:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(){var e=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,$e.modules.hookUI.After),r(t,[{key:"getCommand",value:function(){return"document/save/save"}},{key:"getConditions",value:function(e){return"publish"===e.status}},{key:"getId",value:function(){return"redirect-after-republish"}},{key:"apply",value:function(e){"publish"===e.status&&duplicatePost.originalEditURL&&window.location.assign(duplicatePost.originalEditURL)}}]),t}();$e.hooks.registerUIAfter(new e)}jQuery(window).on("elementor:init",(function(){window.elementor.on("panel:init",(function(){u(),"0"!==duplicatePost.rewriting&&elementor.getPanelView().footer.currentView.removeSubMenuItem("saver-options",{name:"save-template"})}))}))}});
|
1 |
+
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}({11:function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(){var e=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,$e.modules.hookUI.After),r(t,[{key:"getCommand",value:function(){return"document/save/save"}},{key:"getConditions",value:function(e){return"publish"===e.status}},{key:"getId",value:function(){return"redirect-after-republish"}},{key:"apply",value:function(e){"publish"===e.status&&duplicatePost.originalEditURL&&"1"===duplicatePost.rewriting&&window.location.assign(duplicatePost.originalEditURL)}}]),t}();$e.hooks.registerUIAfter(new e)}jQuery(window).on("elementor:init",(function(){window.elementor.on("panel:init",(function(){u(),"0"!==duplicatePost.rewriting&&elementor.getPanelView().footer.currentView.removeSubMenuItem("saver-options",{name:"save-template"})}))}))}});
|
js/dist/{duplicate-post-options-410.js → duplicate-post-options-411.js}
RENAMED
File without changes
|
js/dist/{duplicate-post-quick-edit-410.js → duplicate-post-quick-edit-411.js}
RENAMED
File without changes
|
js/dist/{duplicate-post-strings-410.js → duplicate-post-strings-411.js}
RENAMED
File without changes
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: yoast, lopo
|
3 |
Donate link: https://yoast.com/wordpress/plugins/duplicate-post/
|
4 |
Tags: duplicate post, copy, clone
|
5 |
-
Requires at least: 5.
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 4.1
|
8 |
Requires PHP: 5.6.20
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -151,6 +151,12 @@ New features and customization, WP 3.0 compatibility: you should upgrade if you
|
|
151 |
|
152 |
== Changelog ==
|
153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
= 4.1 (2021-01-27) =
|
155 |
|
156 |
Enhancements:
|
2 |
Contributors: yoast, lopo
|
3 |
Donate link: https://yoast.com/wordpress/plugins/duplicate-post/
|
4 |
Tags: duplicate post, copy, clone
|
5 |
+
Requires at least: 5.6
|
6 |
+
Tested up to: 5.7
|
7 |
+
Stable tag: 4.1.1
|
8 |
Requires PHP: 5.6.20
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
151 |
|
152 |
== Changelog ==
|
153 |
|
154 |
+
= 4.1.1 (2021-01-27) =
|
155 |
+
|
156 |
+
Bugfixes:
|
157 |
+
|
158 |
+
* Fixes a bug where editing posts with Elementor could trigger a fatal error.
|
159 |
+
|
160 |
= 4.1 (2021-01-27) =
|
161 |
|
162 |
Enhancements:
|
src/ui/class-block-editor.php
CHANGED
@@ -199,7 +199,7 @@ class Block_Editor {
|
|
199 |
public function get_original_post_edit_url() {
|
200 |
$post = \get_post();
|
201 |
|
202 |
-
if ( ! $post instanceof WP_Post ) {
|
203 |
return '';
|
204 |
}
|
205 |
|
199 |
public function get_original_post_edit_url() {
|
200 |
$post = \get_post();
|
201 |
|
202 |
+
if ( ! $post instanceof WP_Post || ! $this->permissions_helper->is_rewrite_and_republish_copy( $post ) ) {
|
203 |
return '';
|
204 |
}
|
205 |
|