WordPress.org

Make WordPress Core

Opened 8 months ago

Last modified 8 months ago

#46228 new enhancement

wp_insert_post_data should include $update

Reported by: nhadsall Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch dev-feedback
Focuses: Cc:
PR Number:

Description

wp_insert_post() has a great filter: 'wp_insert_post_data', but it doesn't contain the status of $update (if the post is being updated or new). So, our options are 1. check again if this is an update (redundant) or 2. wait for the 'save_post' action and resave the post with changes (making redundant DB calls). So, it seems the best solution is 3. simply add $update as a parameter to wp_insert_post_data.

Attachments (1)

46228.diff (681 bytes) - added by mukesh27 8 months ago.
Patch.

Download all attachments as: .zip

Change History (2)

@mukesh27
8 months ago

Patch.

#1 @mukesh27
8 months ago

  • Keywords has-patch dev-feedback added

Hi @nhadsall, Welcome to WordPress Trac! Thank you for your ticket.

+1 on your thought as it's great to add $update variable in filter.

Last edited 8 months ago by mukesh27 (previous) (diff)
Note: See TracTickets for help on using tickets.