to add a delete post link in my custom theme,
<?php echo wp_delete_post_link(); ?>
but for some reason it is not deleting all the attached info. Only the post is deleted. I checked the Media Library and the attachments were still there.
How can I implement to delete everything linked to the post?
Note that I am implementing this on the front end and not the admin side.
Ok additionally, i added action for delete_post and in that called wp_delete_attachment function to delete the attachments. But the delete link generated by above mentioned tutorial is giving wp failure page due to invalid nonce calculated. But it works perfect if i change action to trash. I need delete to be working. Can anyone help?