[wp-trac] [WordPress Trac] #36255: Custom Logo: Crop UI

WordPress Trac noreply at wordpress.org
Fri Mar 18 20:27:30 UTC 2016


#36255: Custom Logo: Crop UI
-----------------------------------+--------------------------
 Reporter:  mor10                  |       Owner:  westonruter
     Type:  defect (bug)           |      Status:  accepted
 Priority:  normal                 |   Milestone:  4.5
Component:  Customize              |     Version:  trunk
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:  ui
-----------------------------------+--------------------------
Changes (by celloexpressions):

 * keywords:  has-patch => has-patch 2nd-opinion


Comment:

 I think the missing flex-width/height checks were an oversight, since we
 didn't have any places using it in core yet (but we wanted to provide that
 functionality in the control). This is definitely a place to use both flex
 width and flex height.

 That being said, I'm starting to think that the way logo size is defined
 with `add_theme_support()` is problematic - by using a separately-defined
 image size. If we are going to support crop, wouldn't it be better to let
 the theme directly specify the desired width and height of the logo, and
 also the flex-height and flex-width arguments, in the add theme support
 arguments? For example,

 {{{
 add_theme_support( 'custom_logo', array(
      'width' => 1200, // Suggested width, because flex_width.
      'height' => 175, // Required height, because not flex_height.
      'flex_width' => true,
      'flex_height' => false,
 ) );
 }}}

 Are there any benefits to defining logos as an image size that could end
 up with an arbitrary forced crop, instead of defining the arguments that
 get passed to the customizer control directly? With the above, the theme
 can basically say that it can accommodate images of any aspect ratio as
 long as either the height or the width is fixed at a size (one `flex_` is
 true), images of any size (both `flex_`s are true), or only a specific
 aspect ratio and size (both `flex_`s false). This would also avoid
 creating an extra image size for every image uploaded to a site that isn't
 the logo.

 As an aside, I understood the reasoning for having a separate logo option
 in addition to header images and site icons was that it would be used
 specifically for traditional specifically-designed logos, not general
 images. Header images and site icons are more appropriate for things that
 could be cropped from another image, but if logos are intended to be able
 to operate the same way I really don't see why we would want to have a
 separate logos feature also (keeping in mind that it's not difficult for
 themes to add the appropriate image controls that they may need in the
 Customizer).

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


More information about the wp-trac mailing list