Linux 软件免费装
Banner图

Clone Post with Unsaved Changes to a Draft

开发者 alimuzzamanalim
更新时间 2026年8月24日 22:41
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

clone draft copy duplicate post duplicate page

下载

1.0.0 1.0.1 1.0.3

详情介绍:

Clone Post with Unsaved Changes to a Draft adds a Save As button to the WordPress block editor. One click copies the post you are editing — including its unsaved changes — into a brand-new draft and opens it, so you can branch, version, or template your content without manually duplicating anything. It works with supported Gutenberg posts, pages, and public REST-enabled custom post types. The plugin copies saved core fields and registered taxonomies, then applies supported unsaved block-editor changes. Copies are always drafts. Elementor 4.2.3 post/page documents have a separate, version-pinned adapter that mirrors Elementor's persistent document defaults, captures the unsaved editor snapshot before any save, verifies that Elementor persisted the complete snapshot, and writes it only to the new draft; other versions and document types fail closed. WooCommerce products use WooCommerce's native duplicate workflow only when a block-editor integration invokes the server adapter; classic Woo product screens, product variations, and unsaved Woo-specific fields remain outside this contract. Features How it works The plugin sends a constrained snapshot of the current block-editor state to its own authenticated endpoint. The server reads the saved source post, creates a draft for the current user, then applies supported edits and redirects you to the new draft. Nothing is changed on the original post.

安装:

  1. Upload the clone-post-unsaved-changes folder to the /wp-content/plugins/ directory, or install the plugin through the Plugins screen in WordPress.
  2. Activate the plugin through the Plugins screen.
  3. Edit any existing post or page — the Save As button appears in the editor toolbar.

屏幕截图:

  • The Save As dialog with title, "don't ask", and visibility options.
  • The Save As action in the post sidebar.

升级注意事项:

1.0.3 Adds WordPress 7.1 iframe-editor coverage, bounded custom-post-type metadata cloning, Elementor/WooCommerce adapters, safer retries, and clean production packaging. 1.0.2 Improves Save As reliability with a default copy title, keyboard shortcut, and clearer confirmation when opening a new draft. 1.0.1 Minor styling fix for sidebar button layout. 1.0.0 Initial release.

常见问题:

Does it work on new, unsaved posts?

No. There is nothing to copy until a post has been saved at least once, so the button is hidden on brand-new posts.

Does it copy my unsaved changes?

Yes, for supported block-editor fields: title, content, excerpt, featured media, discussion settings, sticky state for posts, format, template, parent, menu order, REST taxonomies, and registered REST-visible meta. If another dirty field cannot be copied safely, Save As stops before creating a draft.

Does it work with pages and custom post types?

Supported public post types must be available through the REST API and use the block editor. Attachments, autosaves, revisions, and trashed posts are not handled by the generic adapter. WooCommerce products require the native WooCommerce adapter and a block-editor integration; product variations and the standard classic Woo product editor remain unsupported. Custom post types that use Elementor require the separate Elementor adapter.

What gets copied?

Supported core post fields and registered taxonomies are copied, with current editor changes overlaid. The new draft belongs to the current user, has a fresh slug/guid, and does not inherit the source password, dates, status, or author. Sticky state is copied for posts, subject to WordPress's sticky capability. Featured media is reused by ID. Registered show_in_rest meta keys are copied after capability and operational-key checks; a site developer can narrow the exact set with the clone_post_unsaved_changes_allowed_meta_keys filter. WooCommerce product meta is handled only by WooCommerce's native CRUD adapter. The generic adapter does not directly copy files, attachments, comments, revisions, child records, custom tables, or plugin-owned external data.

Does it support Elementor or WooCommerce products?

Elementor 4.2.3 post/page documents use a separate, version-pinned adapter. Save As mirrors Elementor's persistent-setting defaults, captures the current document container settings and element tree without invoking Elementor's save_builder/autosave request, writes the frozen data to a new draft through Elementor's document API, verifies the draft status, persisted element/settings payload, and CSS generation, and checks that the source post, meta, and taxonomy relationships did not change. Other Elementor versions/document types fail closed. WooCommerce products use WooCommerce's own CRUD duplicate workflow for saved product data; unsaved product-specific fields and the normal classic product editor are not claimed as supported.

I hid both buttons — how do I get them back?

Open the editor's ⋮ (Options) menu and choose Save As; that item is always available. Uncheck the "Hide" options in the dialog.

更新日志:

1.0.3 1.0.2 1.0.1 1.0.0