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

Opened 3 years ago

Last modified 3 years 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 (742 bytes) - added by sirzooro 3 years ago.
9084.diff Download (1.6 KB) - added by Denis-de-Bernardy 3 years 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

comment:6   ryan3 years 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.