Skip Navigation

[Resolved] Delete button not showing up for parent post author to delete child post

This thread is resolved. Here is a description of the problem and solution.

Problem:
Delete button not showing up for parent post author to delete child post

Solution:
You can use the [wpv-conditional] shortcode to compare the author IDs of current loggedin user and parent post author.

You can find the proposed solution in this case with the following reply:
=> https://toolset.com/forums/topic/delete-button-not-showing-up-for-parent-post-author-to-delete-child-post/#post-1828309

Relevant Documentation:

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 replies, has 2 voices.

Last updated by aaronW-4 3 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#1825361

Tell us what you are trying to do?
I would like for the author of a parent post to be able to delete the child posts. I created a view to display the child posts on the parent post page. I used the following code, but the link is not showing up where I placed it under the child post within the view:

[cred-delete-post-link class='cred-refresh-after-delete' text='Delete Post' message='Are you sure you want to delete this post?' message_show='1' action='trash']

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1825901

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Do you mean that the current user who is loggedin is a parent post author and to that user you want to allow the capabilities that he should be able to delete the child post? If yes:

I would like to have problem URL where you added the delete post link as well as access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1826847

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Please loggedin as user: toolset@user.com

Please check now: hidden link

I can see the delete link. To display the delete link I've assigned the capability "Delete Others Posts using Toolset Form" to "Collector" role as you can see with the following screenshot: hidden link
=> hidden link

Can you please confirm it works as expected.

#1827391

Hi minesh,
Thank you for attention to this! The only issue now is that a "Collector" can now delete ANY child posts. Is there a way that the "Collector"/author of a parent post has access to only delete the child posts that are within their parent post?

#1828309

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check now: hidden link

I've added the following conditional statement that will check the current loggedin user is equal to the parent post author.

[wpv-conditional if="  ( ( '[wpv-current-user info="id"]' = '[wpv-post-author format="meta" meta="ID" item="@crowd-contribution.parent"]' ) ) " ]
<p>[cred-delete-post-lik class='cred-refresh-after-delete' text='Delete' message='Are you sure you want to delete this Contribution?' message_show='1' action='trash']</p>
[/wpv-conditional]

Does it works as expected now?

#1832339

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.