Doc-section

Registered only if the WordPress Abilities API (wp_register_ability()) is present; otherwise silently skipped.

Category: lh-copy-to-draft (“Copy to Draft”)

lh-copy-to-draft/copy-post

  • Permission: edit_posts baseline gate; each item is additionally checked against edit_post for that specific post ID inside the handler (same capability model as the bulk action and single-copy link — no install_plugins gate, by design).
  • Input: items — array of { post_id: int, custom_overrides?: object }. One entry per post to copy; custom_overrides is optional per item and is forwarded to lh_copy_to_draft_after_duplicate_post for that post as a plain PHP array at every nesting level (no stdClass, regardless of how it arrives) — this ability does not otherwise read or validate its contents.
  • Output: { results: [{ post_id, success, new_post_id?, edit_url?, error? }], copied: int, skipped: int }.
  • Not destructive — creates new drafts only, never modifies or deletes the source post — so it does not use the two-step confirm pattern.
  • Unlike the list-table bulk action, this ability does not redirect anywhere; it always returns the full per-item result set regardless of how many items were requested.