Hi @ab_lu,
there is a filter called duplicate_post_get_clone_post_link which is applied to the URL which goes in the “Clone” or “New Draft” link. You can find it in the file duplicate-post-common.php, in the final return statement of the duplicate_post_get_clone_post_link function.
Let me know if this helps!
I am trying to add the exact same functionality that @ab_lu described above. I looked at the return statement that @lopo referenced in the duplicate-post-common.php with the duplicate_post_get_clone_post_link filter, but I’m not sure how to proceed.
I was wondering if either of you could provide an snippet or pseudo-code of what I should add to my custom theme’s functions.php file in order to achieve this?
I’m not very familiar with hooking into filters in WordPress, so any guidance with a little more detail on how to do this, or an example would be much appreciated.
Thank you.
Thread Starter
Aldo
(@ab_lu)
Hi @lopo
Thanks for the feedback.
But I’m at the same point as @cnvrsepnk.
Can’t get it to work.
We use in the frontend
<?php duplicate_post_clone_post_link( ); ?>
Then we get the link “Copy to a new draft”.
What we try is to set it so, that after the copy has been created, it should be published and the user redirected to the page he has clicked the copy link.
Would be great, if you could point us to the right direction.
Thanks
Aldo
Thread Starter
Aldo
(@ab_lu)
@lopo
Would appreciate any feedback or help.
Thanks.
Thread Starter
Aldo
(@ab_lu)
@lopo Could you point us to the right direction please?