logged in as admin and trying to code that deletes posts to delete an attachment.
<?php if (current_user_can('edit_post', $attachment->ID)) echo "<a href='" . wp_nonce_url("/wp-admin/post.php?action=delete&post=".$attachment->ID."", 'delete-post_' . $attachment->ID) . "'>Delete</a>" ?>
but it just takes me to a page that says;
Are you sure you want to do this? Please try again.
and the please try again links back to the post...
is it something to do with the delete-post_