[wp-trac] [WordPress Trac] #63975: wp_delete_auto_drafts passes post ID as string instead of as int
WordPress Trac
noreply at wordpress.org
Thu Sep 18 14:42:28 UTC 2025
#63975: wp_delete_auto_drafts passes post ID 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 close | Focuses:
-----------------------------------------------+---------------------------
Changes (by SirLouen):
* keywords: has-patch changes-requested needs-test-info => has-patch
changes-requested close
Comment:
Replying to [comment:21 kkmuffme]:
> Totally agree, but the code that will result in a fatal is **not** in
WordPress Core. My code is from a theme or a plugin. What if you need to
use a library/composer package, that uses strict_types=1?
We have to assume that this is something transitional. If you should not
use it in core, you should not use it in plugins. You can do it, but
unexpected things may arise. Remember that I said to you in the first
message that I was not going to take strong typing into consideration,
because code is plagued with this (the ones you can grep plus the ones
I've manually encountered over the months that are countless).
Like I said, my recommendation is to move your PR where I suggested to
you: #63268.
This has been the approved way to proceed in this scenario.
Be aware, that I'm not against you or your type proposal particularly. I
was against of having to deal with a ton of trivial reports individually
without a nice SOP to direct users to the right place.
Now that I have figured this out, I'm good to move forward.
Furthermore, there has been a lot of discussion on how to “upgrade” WP to
be more consistent with this particular kind of "typing" issue when
filters can be on the way.
Check
https://core.trac.wordpress.org/ticket/51525
https://peterwilson.cc/type-declarations-with-wordpress-filters/
(and even @westonruter suggested adding this to the 6.9 roadmap as far as
I can remember)
We are not foreign to this problem. In fact, one of the first things that
came to my mind when I was doing docs review in the `bbPress` plugin was
the fact that hooks had a weak typing protection because returns could
become excessively unpredictable. This particular report is like a grain
of sand of all the issues I've found because of this.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63975#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list