[wp-trac] [WordPress Trac] #42022: Customize: Fix date time control defects

WordPress Trac noreply at wordpress.org
Fri Sep 29 06:32:24 UTC 2017


#42022: Customize: Fix date time control defects
--------------------------+--------------------------
 Reporter:  melchoyce     |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.9
Component:  Customize     |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  ui
--------------------------+--------------------------

Comment (by westonruter):

 @sayedwp Here's a plugin that I've been using for testing the control:
 https://gist.github.com/westonruter/ca1a77f9309af4ab258573cee5ed9d30

 Some additional thoughts:

 We could eliminate the `defaultValue` entirely if we instead instantiate
 the control in JS and pass in the `wp.customize.state(
 'selectedChangesetDate' )` as the `setting` once we have #37964
 implemented. The control then could be registered entirely in JS and not
 in PHP at all, and that would avoid us having to create a settingless
 control to then later link it with another `Value`.

 In the same way, with #30738 we could also add the changeset status
 control with JS and have it linked to the `selectedChangesetStatus` value,
 instead of having to create a secondary Value to sync with. We may want to
 make an array of all of the allowed statuses for changesets, in addition
 to their saved/unsaved labels. Eventually I could see this as being
 something plugins would want to be able to filter, and it would be cleaner
 than having the `choices` for the status in one place and the translation
 labels in another place.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42022#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list