[wp-trac] [WordPress Trac] #63975: wp_delete_auto_drafts passes post ID as string instead of as int
WordPress Trac
noreply at wordpress.org
Mon Sep 29 15:34:10 UTC 2025
#63975: wp_delete_auto_drafts passes post ID as string instead of as int
-------------------------------------------------+-------------------------
Reporter: kkmuffme | Owner: SirLouen
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Posts, Post Types | Version: 3.4
Severity: trivial | Resolution:
Keywords: has-test-info needs-testing has- | Focuses:
patch has-unit-tests |
-------------------------------------------------+-------------------------
Comment (by sajjad67):
== Test Report
=== Description
This report validates whether the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/10061
=== Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.29
- Server: nginx/1.29.1
- Database: mysqli (Server: 8.4.6 / Client: mysqlnd 8.2.29)
- Browser: Chrome 140.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.3
- MU Plugins: None activated
- Plugins:
* Testing 1.0.0
* Test Reports 1.2.0
=== Before Patch
[[Image(https://img001.prntscr.com/file/img001/amCO0S-
MRSejpTNRK2EFSA.png)]]
{{{
Fatal error: Uncaught TypeError: bar(): Argument #1 ($post_id) must be of
type int, string given, called in /var/www/src/wp-
content/plugins/testing.php on line 25 and defined in /var/www/src/wp-
content/plugins/testing.php:29 Stack trace: #0 /var/www/src/wp-
content/plugins/testing.php(25): bar('9') #1 /var/www/src/wp-includes
/class-wp-hook.php(326): foo('9') #2 /var/www/src/wp-includes/class-wp-
hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /var/www/src/wp-
includes/plugin.php(517): WP_Hook->do_action(Array) #4 /var/www/src/wp-
includes/post.php(3798): do_action('before_delete_p...', '9',
Object(WP_Post)) #5 /var/www/src/wp-content/plugins/testing.php(34):
wp_delete_post('9', true) #6 /var/www/src/wp-includes/class-wp-
hook.php(324): maybe_delete_post('') #7 /var/www/src/wp-includes/class-wp-
hook.php(348): WP_Hook->apply_filters(NULL, Array) #8 /var/www/src/wp-
includes/plugin.php(517): WP_Hook->do_action(Array) #9 /var/www/src/wp-
settings.php(730): do_action('init') #10 /var/www/wp-config.php(107):
require_once('/var/www/src/wp...') #11 /var/www/src/wp-load.php(55):
require_once('/var/www/wp-con...') #12 /var/www/src/wp-
admin/admin.php(35): require_once('/var/www/src/wp...') #13 /var/www/src
/wp-admin/_index.php(10): require_once('/var/www/src/wp...') #14
/var/www/src/wp-admin/index.php(10): require_once('/var/www/src/wp...')
#15 {main} thrown in /var/www/src/wp-content/plugins/testing.php on line
29
There has been a critical error on this website. Please check your site
admin email inbox for instructions. If you continue to have problems,
please try the support forums.
Learn more about troubleshooting WordPress.
}}}
=== After Patch
1. ✅ Issue resolved with patch.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63975#comment:38>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list