Closed therealgilles closed 3 years ago
Maybe this fix would do:
if ( ! empty( $parent ) ) {
$attachment_post_type = array( $parent->post_type );
}
Hey @therealgilles, thanks for your issue and for taking the time to hunt down the problem. I fixed the problem in https://github.com/mindkomm/timmy/commit/43cb35b4766da25b7c2adfbe997e03fe047eead7 and released the fix in a new version.
I am getting a PHP warning in the following function on the line marked '<-- HERE' because $parent is empty/null:
I'm not sure exactly why the attachment parent ID is invalid for the photo. The image is used in an ACF image field, so it's not attached to a particular post. When I try to find the post corrresponding to the attachment parent ID, WordPress tells me that maybe it was deleted.