I'm using this code to delete posts on the front end. (Only logged-in admin can see the Delete Post link on the blog page.)
But, I'd like to also wrap this code in an IF/THEN so that it only shows up for certain categories. I'm not a PHP programmer. Can any one suggest how to do it? Thanks.
Here's the code: (in the loop of index.php in my theme)
<?php if (current_user_can('edit_post', $post->ID)) echo "<a href='" . wp_nonce_url("/wp-admin/post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "'>Delete post</a>" ?>
Found it here: http://wordpress.org/support/topic/118769