WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#23759 closed enhancement (duplicate)

Pass $update to save_post and wp_insert_post actions

Reported by: alex-ye Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.5.1
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

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 9 years ago.

Download all attachments as: .zip

Change History (8)

@alex-ye
9 years ago

#1 @alex-ye
9 years ago

  • Version set to 3.5.1

#2 @alex-ye
9 years ago

  • Cc nashwan.doaqan@… added

#3 follow-up: @SergeyBiryukov
9 years 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

#4 in reply to: ↑ 3 @alex-ye
9 years 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 :)

#5 @nacin
9 years 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.

#6 @alex-ye
8 years ago

This was fixed in changeset [24977] , so close this ticket as fixed.

Last edited 8 years ago by SergeyBiryukov (previous) (diff)

#7 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #21450.

Note: See TracTickets for help on using tickets.