Opened 9 years ago
Closed 9 years ago
#42175 closed defect (bug) (fixed)
Customize: Remove call to `wp_trash_post()`
| Reported by: | dlh | Owned by: | westonruter |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.9 |
| Component: | Customize | Version: | 4.9 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
WP_Customize_Manager::handle_changeset_trash_request() includes a call to wp_trash_post(), which was purposefully not called in _wp_customize_publish_changeset() because it "will mutate the post_content and the post_name."
As discussed in Slack, the logic for trashing a changeset could be moved to a method in WP_Customize_Manager that both functions can use: https://wordpress.slack.com/archives/C0381N237/p1507503461000055.
Note that it might make sense for this logic to one day be moved again to a dedicated WP_Customize_Changeset class. The method in the attached patch is largely borrowed from the latest patch in #40527.
The patch also adds the 'pre_trash_post' filter from [41638].
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 41824: