• Resolved Sam Pryor

    (@sampryor)


    Hi, I need to rename the cloned post after it is cloned. Is there an action hook I can use to run my code after the clone is created?

    I have tried wp_insert_post, and save_post, but these fire too early and the ACF fields are not yet copied in.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Enrico Battocchi

    (@lopo)

    Hi @sampryor,
    you can hook your function to dp_duplicate_post (or dp_duplicate_page) which is executed after the post content is saved to the database. Check the links to access the documentation.

    The same action is used to copy the custom fields, with priority 10, so if you use an higher priority you’ll find them stored in the DB and you can use them in your function — the original post is a parameter anyway so you can always read from that.

    I hope this helps!

    Thread Starter Sam Pryor

    (@sampryor)

    Perfect, thank you for the quick response!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Action hook after clone is complete’ is closed to new replies.