Tell us what you are trying to do?
Add a button / link to a list of posts that allows to delete the referring post , which I already accomplished, but ...
If that button / link will be hit, I need to hook into the process and catch post_id and a specific post meta before that post will be deleted in order to delete further posts and the matching user to which those posts refer (we are talking about patient files here) as well as referring file upload paths of the 'wordpress file download' plugin by JoomUnited.
Is there any documentation that you are following?
Checked the list of toolset hooks but didn't find a match - to my understanding of those hooks - at first glance. English isn't my primary language so I might have ignored accidentally.
What is the link to your site?
hidden link
Are there any Toolset or native WordPress pre-deletion hooks that include the ID of the post to be deleted?
Regards,
Sven
Hi Sven,
Toolset has a hook to redirect the page to a new URL while deleting a post:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_redirect_after_delete_action
The purpose of cred_redirect_after_delete_action is to redirect the page after delete, but the good point is that you will have access to the post ID that is being deleted. So there you can access the meta information of the post and do whatever is needed.
Also, the "cred_before_save_data" hook is another one and it will trigger before any data is processed, so you can make use of that if needed.
https://toolset.com/documentation/programmer-reference/cred-api
As this is a customization you might need a developer to help you out, if that is the case, then we suggest that you take a look here for hiring one:
https://toolset.com/contractors
Thank you.
Hi Christopher,
thanks for the input. Just to be clear: cred_before_save_data also fires on deletions, not only on creations?
Regards,
Sven
Hi Sven,
I did not check that personally but from the look of the description, it should be. I suggest that you test that by forcing the PHP to die() and see if it triggers on delete:
hidden link
If it triggers, then the website will break. Then you will know that it triggers on Delete or not.
If not, you can use the other one that I mentioned which definitely triggers before dthe elete action.
Thank you.