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_postsbaseline gate; each item is additionally checked againstedit_postfor that specific post ID inside the handler (same capability model as the bulk action and single-copy link — noinstall_pluginsgate, by design). - Input:
items— array of{ post_id: int, custom_overrides?: object }. One entry per post to copy;custom_overridesis optional per item and is forwarded tolh_copy_to_draft_after_duplicate_postfor that post as a plain PHP array at every nesting level (nostdClass, 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.