Deleting Custom Post Type on Frontend

I have a child theme setup using the X theme. WooCommerce customers are creating custom post types using Gravity Forms and then the customer is assigned as the Author of the post. I have this bit of code on a page that allows them to delete the custom post:

<?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 Post[/a][/li]

<?php endif; ?>

As an Administrator I can see and click the delete button just fine and the custom post type gets deleted on the backend. However when I’m the customer user I can see the delete button, but nothing happens when I try to delete the profile. The confirmation dialog works but when I click yes to confirm it stays on the page and nothing occurs. I have the correct permissions set up for the customer role under the X Theme options > Settings > Permissions to Add Elements and Delete Elements along with Dynamic Content. I also have the Capability Manager Enhanced plugin installed so that I can have the customer roles delete posts and delete published posts.

What else do I need to be able to have customers delete posts on the frontend?

Hello Hedy,

The customers may not be allowed to delete any posts, pages or products. Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself. If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries.

Thank you for your understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.