WordPress.org

Make WordPress Core

Opened 3 months ago

Last modified 3 months ago

#23759 new enhancement

Pass $update to save_post and wp_insert_post actions

Reported by: alex-ye Owned by:
Priority: normal Milestone: Awaiting Review
Component: Post Types Version: 3.5.1
Severity: normal Keywords: has-patch
Cc: nashwan.doaqan@…

Description

For now it's hard to check if the post is updated or publish for the first time when using save_post and wp_insert_post hooks

Attachments (1)

post.php.patch (1016 bytes) - added by alex-ye 3 months ago.

Download all attachments as: .zip

Change History (6)

alex-ye3 months ago

comment:1 alex-ye3 months ago

  • Version set to 3.5.1

comment:2 alex-ye3 months ago

  • Cc nashwan.doaqan@… added

comment:3 follow-up: SergeyBiryukov3 months ago

  • Component changed from General to Post Types

For now it's hard to check if the post is updated or publish for the first time

Post status transition actions can be used as a workaround:
http://codex.wordpress.org/Post_Status_Transitions

Related: #21450

comment:4 in reply to: ↑ 3 alex-ye3 months ago

Replying to SergeyBiryukov:

For now it's hard to check if the post is updated or publish for the first time

Post status transition actions can be used as a workaround:
http://codex.wordpress.org/Post_Status_Transitions

Related: #21450

Yes it could be used , but Post_Status_Transitions it's different form what I ask , especially when you want all things in one function I currently check $_POSTupdate? in the back-end , but what about when you make some staff in the front-end ...

I read the Related ticket but and I think we cant make the both in the core :)

comment:5 nacin3 months ago

There are already pre_post_update, edit_post, and post_updated hooks. I'd rather not add something else to the ubiquitous save_post hook, too.

Note: See TracTickets for help on using tickets.