Ticket #9084 (closed defect (bug): fixed)

Opened 12 months ago

Last modified 9 months ago

Problem when wp_insert_post_data filter changes post status

Reported by: sirzooro Owned by: Denis-de-Bernardy
Priority: normal Milestone: 2.8
Component: General Version: 2.7
Severity: major Keywords: has-patch tested commit
Cc:

Description

wp_insert_post() calls wp_insert_post_data filter and then continues without updating local variables. This can cause problems when filter will change them. I found this issue after I created plugin which changes posts status back to Draft if some conditions are not met. After this status change transition_post_status action is invoked with incorrect new state parameter. Because of this WP Status Notifier plugin incorrectly sends emails with notifications.

Attachments

patch.diff Download (0.7 KB) - added by sirzooro 12 months ago.
9084.diff Download (1.6 KB) - added by Denis-de-Bernardy 10 months ago.

Change History

  • keywords has-patch needs-testing added
  • keywords tested added; needs-testing removed
  • milestone changed from 2.7.2 to 2.8

new patch prevents the needless and potentially overwriting of too much data

  • keywords commit added

commit? wontfix?

  • severity changed from normal to major
  • owner changed from anonymous to Denis-de-Bernardy
  • status changed from new to accepted

ryan9 months ago
  • status changed from accepted to closed
  • resolution set to fixed

(In [11396]) Use filtered post data. Props Denis-de-Bernardy, sirzooro. fixes #9084

Note: See TracTickets for help on using tickets.