[wp-trac] [WordPress Trac] #56170: Bulk delete media attachments doesn't pass integer values to wp_delete_attachment

WordPress Trac noreply at wordpress.org
Wed Feb 1 21:23:43 UTC 2023


#56170: Bulk delete media attachments doesn't pass integer values to
wp_delete_attachment
--------------------------+-----------------------------
 Reporter:  eherman24     |       Owner:  joedolson
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  6.2
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  administration
--------------------------+-----------------------------
Changes (by joedolson):

 * keywords:  has-patch 2nd-opinion => has-patch
 * status:  reviewing => accepted


Comment:

 The provided patch fixes the immediate issue, but doesn't cover the same
 issue with `wp_trash_post` and `wp_untrash_post` earlier in the same
 function, which also expect `int` arguments.

 Alternate version of patch ensures that `$post_ids` is an array of
 integers from the beginning of the function, simplifying the code by
 making the (array) and (int) casting unnecessary.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56170#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list