Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#9084 closed defect (bug) (fixed)

Problem when wp_insert_post_data filter changes post status

Reported by: sirzooro's profile sirzooro Owned by: denis-de-bernardy's profile Denis-de-Bernardy
Milestone: 2.8 Priority: normal
Severity: major Version: 2.7
Component: General Keywords: has-patch tested commit
Focuses: 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 (2)

patch.diff (742 bytes) - added by sirzooro 15 years ago.
9084.diff (1.6 KB) - added by Denis-de-Bernardy 15 years ago.

Download all attachments as: .zip

Change History (8)

@sirzooro
15 years ago

#1 @sirzooro
15 years ago

  • Keywords has-patch needs-testing added

#2 @Denis-de-Bernardy
15 years ago

  • 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

#3 @Denis-de-Bernardy
15 years ago

  • Keywords commit added

commit? wontfix?

#4 @Denis-de-Bernardy
15 years ago

  • Severity changed from normal to major

#5 @Denis-de-Bernardy
15 years ago

  • Owner changed from anonymous to Denis-de-Bernardy
  • Status changed from new to accepted

#6 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

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

Note: See TracTickets for help on using tickets.