Skip to content

BUG: Thumbnails are not removed from indexed WooCommerce Products when the attachments are deleted #3254

Closed
@JakePT

Description

Describe the bug

When deleting an attachment the _thumbnail_id meta is removed from any posts that used the image as a featured image. Indexed posts should be updated to reflect this change, but when deleting an attachment that is used as the featured image of a WooCommerce Product the indexed Product is not updated. Posts are updating as expected.

Steps to Reproduce

  1. Upload an image attachment.
  2. Create two Products, set the uploaded attachment as the featured image for both.
  3. Check the indexed Products, they should include metadata containing the thumbnail ID.
  4. Delete the attachment.
  5. Check the indexed Products, they will still include metadata containing the thumbnail ID.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress and ElasticPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions