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

dp_duplicate_page

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

Called right after the WordPress standard fields of a page, or a 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.