[wp-trac] [WordPress Trac] #63975: wp_delete_auto_drafts passes post type as string instead of as int

WordPress Trac noreply at wordpress.org
Mon Sep 15 13:51:37 UTC 2025


#63975: wp_delete_auto_drafts passes post type as string instead of as int
-----------------------------------------+------------------------------
 Reporter:  kkmuffme                     |       Owner:  kkmuffme
     Type:  defect (bug)                 |      Status:  assigned
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Posts, Post Types            |     Version:  3.4
 Severity:  trivial                      |  Resolution:
 Keywords:  has-patch changes-requested  |     Focuses:
-----------------------------------------+------------------------------

Comment (by SirLouen):

 Replying to [comment:5 kkmuffme]:
 > Anyway, while debugging, cron suddenly report a fatal TypeError for a
 method with type hint "int" on the delete action, since it received a
 string, even though it expected an int.

 For full correctness, I would remove `(array)` as it is an extra
 unnecessary check and add the `(int)` as I said. But WP is not strongly
 typed, and obviously strict typing reports are not relevant unless real
 risks have been observed.

 But I also know that @SergeyBiryukov loves this kind of patches, so I'm
 pinging him in case he wants to merge it :)

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


More information about the wp-trac mailing list