[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 13:04:15 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 needs- | Focuses:
test-info |
-------------------------------------------------+-------------------------
Comment (by kkmuffme):
So, were you able to reproduce it?
Checked it, it says:
>Strict typing should not be used in **WordPress Core** at this time.
>as a lot of **WordPress Core** relies on the loose type nature of PHP
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?
Also it's not a problem to use lose types. They just should be documented
correctly then in the phpdoc, e.g. int|string (or int|numeric-string if
one wants to be more specific)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63975#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list