I'm trying to add a function when a post is delete.
I need to update a custom field value of a post when another post is deleted.
I've add in my function.php this function:
Hello. Thank you for contacting the Toolset support.
Well - are you deleting posts from Trash? Could you please share more information from where you are trying to delete the posts - from backend (admin) or front-end?
Well - the hook before_delete_post will only work when you try to delete the post permanently I mean when you delete posts from Trash.
Please check the following note:
It's important to note the hook runs only when the WordPress user empties the Trash. If you're using this hook note that it will not fire if the user is deleting an Attachment, since attachments are force deleted, i.e., not sent to the Trash. Instead use the delete_post() hook.
*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.