Commit Graph

11 Commits

Author SHA1 Message Date
Christopher Allford 070954c888 Revert #28187
The default functionality within the `ThemeSupport` class has an unintended
side-effect of breaking the existing default functionality within the
`wc_get_theme_support()` function. Since the default set in the support
class is prioritized over the one given to `ThemeSupport::get_option()`,
the WordPress options set in the Customizer are never used for images.
2021-05-21 12:10:15 -07:00
Nestor Soriano 3a895c9eed
Move ThemeSupport class to Internal namespace, and use in 2021 theme. 2021-04-21 12:57:56 +02:00
Nestor Soriano d620f1d232 Fix #25900 - image size customisation controls not shown
- Added the `ThemeSupport class`, with methods to add and get
  theme support options.
  - It also has a new `add_default_options` method that adds the
    options under a `_defaults` key.
- The `WC_Twenty_*` classes now use `ThemeSupport` instead of
  the `add_theme_support` function to define image and thumbnail sizes.
  - The values are defined as default options.
- The `WC_Shop_Customizer` class now uses `ThemeSupport` instead of
  `wc_get_theme_support` to check if image and thumbnail sizes UI
  should be rendered.
  - The check is made excluding default values.

With these changes the UI to change the image and thumbnail sizes
is hidden only if the options are added as non-defaults elsewhere.

Additional changes:

- The code of the `wc_get_theme_support` function is replaced with
  a simple call to `get_option` in `ThemeSupport`.
- Added the utility class `ArrayUtil`.
2020-11-04 13:01:53 +01:00
Claudio Sanches d48f1d4e2e Fixed package tag usage 2020-08-05 13:36:24 -03:00
Christopher Allford 1d1413b4ee Replaced direct access of many constants with the Constants library 2020-01-31 22:18:47 -08:00
Rodrigo Primo 62d6b05b58 Fix Generic.Formatting.MultipleStatementAlignment violations
This commit fixes all violations of the Generic.Formatting.MultipleStatementAlignment sniff automatically using phpcbf.
2019-12-20 14:21:08 -03:00
Peter Fabian f50d8ffdd1 Fixed PHPCS. 2019-11-26 20:54:04 +01:00
Peter Fabian f3892359f3 Make thumbnail larger, improve shop layout. 2019-11-24 09:51:15 +01:00
Peter Fabian 9c74bf79ea Rather than setting the background in CSS, use the color picked in the
customizer.

This also fixes the background in the block editor and tinymce.
2019-11-22 15:37:54 +01:00
Peter Fabian daf4a53acf Make single images larger. 2019-11-19 19:36:10 +01:00
Peter Fabian bc04b8f45b Added basic declaration for WC support to Twentytwenty. 2019-11-19 17:58:16 +01:00