Commit Graph

8 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
Rodrigo Primo 7337ab60c2 Fix PEAR.Functions.FunctionCallSignature violations
This commit fixes all violations of the PEAR.Functions.FunctionCallSignature sniff automatically using phpcbf.
2019-12-20 15:25:23 -03:00
Mike Jolley 6e83fcec50 Sizes for 3 cols default 2018-01-25 17:03:01 +00:00
Mike Jolley e025caf177 Widths and aspect ratios 2017-11-07 18:32:43 +00:00
Mike Jolley fb8c6cd0d2 Add compat class for each wp default theme 2017-11-07 12:11:37 +00:00