[wp-trac] [WordPress Trac] #63115: wp_insert_post missing do_action for pre_post_insert
WordPress Trac
noreply at wordpress.org
Thu Oct 16 10:47:11 UTC 2025
#63115: wp_insert_post missing do_action for pre_post_insert
-------------------------------+-----------------------
Reporter: Hrohh | Owner: audrasjb
Type: enhancement | Status: closed
Priority: normal | Milestone: 6.9
Component: Posts, Post Types | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch commit | Focuses:
-------------------------------+-----------------------
Comment (by nikunj8866):
I agree with @westonruter, the `wp_insert_post_data` filter is indeed the
right place for developers to modify data before insertion or update.
I also think having a `pre_post_insert` action would be valuable. It could
serve as a companion to `pre_post_update`, allowing developers to run
additional logic before a new post is inserted.
For example, one practical **use case** would be enforcing a **unique post
title** cross the site for a specific post type. The `pre_post_insert`
action would make this type of validation straightforward to implement.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63115#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list