0

I have a custom admin page.

On it, I have created a filtered list of the custom post type based on postmeta data.

I have to create a link to delete that post.

I am trying to figure out how to create the link with a nonce.

sprintf('<a href="post.php?post=%s&action=%s&_wpnonce=%s" class="link-course-delete">Trash</a>',$item['ID'],'trash',wp_create_nonce(???))

I am not sure what value to pass to wp_create_nonce to make it work.

1 Answer 1

1

I found the answer - this contains sample code which helped me resolve the issue.

https://codex.wordpress.org/WordPress_Nonces

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.