Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Theme support to declare image sizes #17610
This closes #17557
Allows image sizes to be defined using add_theme_support. If used, image settings in WooCommerce are hidden. Includes support for all default WP themes.
Themes can pass in the image widths they want to use. e.g.
If present, these settings take priority over settings, and settings are hidden.
There is a new setting called 'thumbnail cropping' which then allows the end user to select:
Sizes are then calculated from the given widths.
Single product images are uncropped and not affected by ratio settings.
After changing settings, regenerate thumbnails needs to run or the changes will not be visible. #12880 will handle this.
referenced this pull request
Nov 7, 2017
@@ Coverage Diff @@ ## master #17610 +/- ## ========================================= Coverage ? 34.88% Complexity ? 12187 ========================================= Files ? 332 Lines ? 49997 Branches ? 0 ========================================= Hits ? 17442 Misses ? 32555 Partials ? 0
The preview looks a bit odd on larger and smaller screens. Let's just move it below the settings;
Overall it works great. I'll tweak the preview styling once you've moved it.
Edit: One minor point, would it be possible to update the preview as you update the input rather than when you focus off it? Also noticed it's possible to add decimal values. We should probably not allow that.