1. Home
  2. Developer’s guide
  3. Actions
  4. dp_duplicate_post

dp_duplicate_post

do_action( 'dp_duplicate_post', int $new_post_id, WP_Post $post, string $status )

Called right after the WordPress standard fields of a post, or a non-hierarchical custom type item, have been copied.
Duplicate Post itself hooks some functions to this action to copy custom fields, taxonomies, attachments, comments etc.

Parameters

  • $new_post_id
    • (int) The ID of the new post.
  • $post
    • (WP_Post) the original post object
  • $status
    • (string) the destination status as set by the calling method: e.g. ‘draft’ if the function has been called using the “New Draft” links, ” (empty string) otherwise.