[wp-trac] [WordPress Trac] #42175: Customize: Remove call to `wp_trash_post()`
WordPress Trac
noreply at wordpress.org
Wed Oct 11 04:05:21 UTC 2017
#42175: Customize: Remove call to `wp_trash_post()`
--------------------------+-----------------------------
Reporter: dlh | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: trunk
Severity: normal | Keywords: has-patch
Focuses: |
--------------------------+-----------------------------
`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].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42175>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list