[wp-trac] [WordPress Trac] #29211: Customizer: extract a cropped-image control from header images

WordPress Trac noreply at wordpress.org
Thu Aug 14 06:16:06 UTC 2014


#29211: Customizer: extract a cropped-image control from header images
------------------------------+----------------------------
 Reporter:  celloexpressions  |      Owner:
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Future Release
Component:  Customize         |    Version:  3.9
 Severity:  normal            |   Keywords:  needs-patch
  Focuses:  javascript        |
------------------------------+----------------------------
 Headers in the Customizer do some awesome stuff like allowing an image
 selected from the media library to be cropped to specific dimensions. We
 should extract this functionality to a new control, which headers would
 extend, that allows developers to specify exactly the image size needed
 for a given image.

 Possible API for developers to add such a control:
 {{{
 $wp_customize->add_control( new WP_Customize_Cropped_Image_Control(
         $wp_customize,
         'setting_id',
         array( // Control args, including inherited ones like label,
 description, section, etc.
                 'width'  => 200, // px, defaults to 0 (flex-width)
                 'height' => 200, // px, defaults to 0 (flex-height)
         ),
 ) );
 }}}

 This control would obviously extend WP_Customize_Image control ideally,
 once we hook it up to the media modal.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29211>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list