I am trying to use the same code on the hook
before_delete_post to find the $parent_id ( i am not using forms to delete the post, I am doing it from the dashboard ) and the function that I call on this action has input only the $post_ID
PHP Notice: Undefined index: @album-collection-target_parent ....
PHP Fatal error: Uncaught InvalidArgumentException: All provided arguments for a related element must be either an ID or a WP_Post object ...
pointing to a line of code --> $parent_id = $_REQUEST[$param];
if I have understood correctly the error is coming from here $param = '@' . $relationship . '_parent';
so my ---------------- QUESTION is -------------------------
how to find the parent of a post when i have the post_id
Can you please try to use that and let me know if that works. If no: then I will require problem URL where you are trying to delete the entry as well as access details and please tell me where you added the existing code.
*** 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.