Title: The duplicate_post_create_duplicate function doesn&#8217;t support post_id
Last modified: June 19, 2018

---

# The duplicate_post_create_duplicate function doesn’t support post_id

 *  Resolved [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * (@garrett-eclipse)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/the-duplicate_post_create_duplicate-function-doesnt-support-post_id/)
 * Hello,
 * Trying to use the duplicate_post_create_duplicate function found here;
    [https://duplicate-post.lopo.it/docs/developers-guide/functions-template-tags/duplicate_post_create_duplicate/](https://duplicate-post.lopo.it/docs/developers-guide/functions-template-tags/duplicate_post_create_duplicate/)
 * It notes that post_id is supported;
 * > $post
   >  (int|WP_Post|null) post object to be cloned.
 * But checking source after I got the message;
    “Copy features for this post type
   are not enabled in options page”
 * I noticed the function used $post object without checking for an int and switching
   post_id to a post object;
    `if (!duplicate_post_is_post_type_enabled($post->post_type)&&
   $post->post_type != 'attachment')`
 * I’m going to switch in my code to use a post object, but might be a good call
   to do a check for ID(int) and do a get_post before using $post object.
 * Thank you
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fthe-duplicate_post_create_duplicate-function-doesnt-support-post_id%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘The duplicate_post_create_duplicate function doesn’t support post_id’
is closed to new replies.

 * ![](https://ps.w.org/duplicate-post/assets/icon-256x256.png?rev=2336666)
 * [Yoast Duplicate Post](https://wordpress.org/plugins/duplicate-post/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/duplicate-post/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/duplicate-post/)
 * [Active Topics](https://wordpress.org/support/plugin/duplicate-post/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/duplicate-post/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/duplicate-post/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Garrett Hyder](https://wordpress.org/support/users/garrett-eclipse/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/the-duplicate_post_create_duplicate-function-doesnt-support-post_id/)
 * Status: resolved