I have this link from a CPT, to clone a post, in this case post=30808
:
https://domain.com/wp-admin/admin.php?action=duplicate_post_clone&post=30808&_wpnonce=240f0078e7
Now, I need to use this within a jquery script like this:
$('body.post-type-pessoas .page-title-action').replaceWith( '<a href="https://domain.com/wp-admin/admin.php?action=duplicate_post_clone&post=30808&_wpnonce=240f0078e7" class="page-title-action">Clonar Modelo PESSOA</a>' );
});
(this will replace the "New Post" button with "Clonar Modelo PESSOA" with the same link)
The thing is that after several days the link won't work because of the wpsnonce lifetime. I don't want to remove the wpsnonce lifetime due to security issues.
My question is how do I get the correct and actualized link?
Thank you.
AMP.