How to add/retrieve the post trash link?

Just use get_delete_post_link( $post_ID ) – it’ll return the absolute URL with nonce and all!

Just to be clear, this will get the link to trash posts (if trash supported). If you want to skip trash & get the perma-delete link, pass a second argument of true*.

http://codex.wordpress.org/Function_Reference/get_delete_post_link

Update: Having checked the source, it seems the codex is a little out of date. The second argument is deprecated, so pass an empty string & the third arg as true:

get_delete_post_link( $post_ID, '', true );

Leave a Comment