[wp-trac] [WordPress Trac] #21785: Add header image uploads with cropping to the customizer

WordPress Trac noreply at wordpress.org
Wed Mar 5 17:20:17 UTC 2014


#21785: Add header image uploads with cropping to the customizer
----------------------------+-----------------------------
 Reporter:  nacin           |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  Future Release
Component:  Appearance      |     Version:  3.4
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:  javascript
----------------------------+-----------------------------

Comment (by gcorne):

 I spent some time playing around with this and looking at the code and
 fixed up the following small issues in [attachment:21785-03.patch
 21785-03.patch].

 * Unbound the resize event handler when the Cropper view is removed
 * Extend {{{WP_Customize_Image_Control}}} instead of
 {{{WP_Customize_Control}}} so properties such as {{{get_url}}} are
 declared before the class is instantiated.
 * Switched the "Skip Cropping" to using the secondary button style instead
 of primary.
 * Cleaned up some whitespace issues.

 For fun, I also pushed these changes to a branch on Github:
 https://github.com/gcorne/develop.wordpress/tree/trac-21785-03

 One thing that I didn't fix that I think we should address is how the new
 ajax handlers work. Instead of sending a string when an error occurs, we
 should be using {{{wp_json_send_error}}} and {{{wp_json_send_success}}}.
 Right now, if there is an error when cropping, {{{JSON.parse()}}} throws
 an error and the modal is stuck until the user closes it.

 I also wonder if we should change the terminology used for the buttons in
 the customizer. "Hide" and "Add new" don't feel quite right. I was
 thinking maybe it should be "Add" when there isn't a header image set,
 "Remove" and "Replace" when there is a single image set, and "Remove" and
 "Add" when the header image is set to randomize.

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


More information about the wp-trac mailing list