Delete Custom Post Type on the front-end
-
I’ve got a page with a link to delete a custom post type based on id that’s passed in the query vars. I’ve updated the user role customer, (woocommerce), to be able to delete_posts and delete_published_posts. These custom posts are created via Gravity Forms with the author being set to the customer who created it. The delete button shows up fine, but when clicked doesn’t actually delete anything. What else do I need to be able to have customers delete their own posts?
<?php if ( current_user_can( 'delete_post', $custom_post_id ) ) : ?> <li class="deleteprofile"><a onclick="return confirm('Do you really want to delete this post?')" href="<?php echo get_delete_post_link($custom_post_id); ?>">Delete Profile</a></li> <?php endif; ?>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Delete Custom Post Type on the front-end’ is closed to new replies.