[wp-trac] [WordPress Trac] #36738: No validation for $post_date_gmt parameter
WordPress Trac
noreply at wordpress.org
Fri Sep 12 12:14:44 UTC 2025
#36738: No validation for $post_date_gmt parameter
-------------------------------------------------+-------------------------
Reporter: Latz | Owner:
| paulbonneau
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Posts, Post Types | Version: 3.5
Severity: normal | Resolution:
Keywords: has-test-info good-first-bug has- | Focuses:
patch has-unit-tests |
-------------------------------------------------+-------------------------
Comment (by paulbonneau):
Hi again @pmbaldha,
You need to indicate `true` as the second parameter of `wp_insert_post` in
order for this function to return a WP_Error object. If this parameter is
set to false or omitted the function must return `0` in case of insertion
failure.
For this reason, it does not disqualify this patch as a solution to the
problem reported by @Latz.
Thanks for your tests
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36738#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list