Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #60052, comment 9


Ignore:
Timestamp:
02/20/2025 07:35:38 AM (9 months ago)
Author:
anthonythorne
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #60052, comment 9

    v1 v2  
    11Testing Criteria & Summary of Unit Test
     2
    23Testing Criteria:
    34Ensure that an attachment can be deleted even when the post_tag taxonomy has been unregistered.
     
    56Simulate real-world conditions by unregistering both category and post_tag taxonomies before deleting the attachment.
    67Confirm that the function returns a valid WP_Post object upon successful deletion.
     8
    79Unit Test Summary:
    810This unit test creates a test attachment, unregisters the category and post_tag taxonomies, and then attempts to delete the attachment using wp_delete_attachment(). In previous versions, deleting an attachment after unregistering post_tag could cause a failure (#60052). The test ensures that after the core patch, the function correctly handles missing taxonomies and successfully deletes the attachment. The test also explicitly removes taxonomy entries from $wp_taxonomies to fully replicate the missing taxonomy scenario.