I'm trying to post a delete Link for a user so he can delete his own entries:
global $post; if ( !current_user_can( 'delete_bkroadkill', $post->ID ) ) return; $link = "<a href='" . wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?action=delete&post=" . $post->ID, 'delete-post_' . $post->ID) . "'>".$link."</a>"; echo $before . $link . $after;
How can I also delete the attachment of the post with this?