[wp-trac] [WordPress Trac] #32403: Provide ability to crop background image

WordPress Trac noreply at wordpress.org
Wed Jan 27 08:37:48 UTC 2016


#32403: Provide ability to crop background image
-------------------------+------------------------------
 Reporter:  johnbillion  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Customize    |     Version:  3.9
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  administration
-------------------------+------------------------------

Comment (by Fab1en):

 I agree with @celloexpressions : cropping a background image is not just
 about using `WP_Customized_Cropped_Image_Control`. It's much more likely
 for a background image than for a header one to not be displayed in full,
 or to appear in full width but not full height. Today it's tricky to
 manage this case with the cropping tool in the customizer.

 I think it would be better to let theme authors define it themselves. It's
 easy to redefine the default background image customization and use
 `WP_Customized_Cropped_Image_Control` where needed. In my opinion, it's
 not useful to change the behavior of the background image feature defined
 by default.

 One possibility to introduce this change without too much noise, would be
 to add a new parameter to the `add_theme_support` call :


 {{{#!php
 $defaults = array(
         'default-color'          => '',
         'default-image'          => '',
         'default-repeat'         => '',
         'default-position-x'     => '',
         'default-attachment'     => '',
         'wp-head-callback'       => '_custom_background_cb',
         'admin-head-callback'    => '',
         'admin-preview-callback' => '',
         'allow-cropping'         => false,
 );
 add_theme_support( 'custom-background', $defaults );
 }}}

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


More information about the wp-trac mailing list