[wp-trac] [WordPress Trac] #42206: Customize: Facilitate including changeset title with save requests
WordPress Trac
noreply at wordpress.org
Fri Oct 13 04:08:42 UTC 2017
#42206: Customize: Facilitate including changeset title with save requests
-------------------------+-----------------------------
Reporter: dlh | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Customize | Version: 4.7
Severity: normal | Keywords: has-patch
Focuses: |
-------------------------+-----------------------------
Allowing users to set the title of a Customize changeset is useful on
sites that enable both changeset branching and a post list table for saved
changesets. However, there's currently no "official" way to control the
title of a changeset submitted with the `'customize_save'` Ajax request.
Unofficially, one workaround is to replace the default "Save" button with
a custom button that provides more control over what happens when the user
saves their changes. But the default "Save" button's added powers in 4.9
makes replacing it less feasible.
[https://wordpress.slack.com/archives/C0381N237/p1507760750000265 As
discussed in Slack], one way to provide more control over the title is to
trigger an event before sending the `'customize_save'` request, which is
the approach I've tried in the attached patch.
Another idea from the Slack discussion was adding a `changesetTitle`
state. I decided to try the event first because (a) managing the state
adds a lot of overhead for a feature with no core UI now, (b) a future
core UI for the title might benefit from some other approach than a
`changesetTitle` state, and (c) an event might scale more easily to future
changeset parameters that also don't have a core UI.
I named the event `'customize-save'` for consistency with the Ajax action.
`'save-data'` was suggested in Slack, but I decided against it because the
PHP filter by that name passes parameters that seem closer to the existing
`'changeset-save'` event. Of course, the name could be anything.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42206>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list