Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duotone appears with 6.2 even when disabled with theme.json #49541

Closed
smerriman opened this issue Apr 3, 2023 · 3 comments
Closed

Duotone appears with 6.2 even when disabled with theme.json #49541

smerriman opened this issue Apr 3, 2023 · 3 comments
Labels
[Block] Image Affects the Image Block Customization Issues related to Phase 2: Customization efforts [Type] Regression Related to a regression in the latest release

Comments

@smerriman
Copy link

Description

Prior to 6.1, duotone filters could be disabled with theme.json. Now they cannot.

Step-by-step reproduction instructions

< 6.2, the following in theme.json disabled all color options, including duotone:

{ "version":2, "settings": { "color": { "palette": [], "custom": false, "gradients": [], "customGradient": false } } }

I have tried updating this to:

{ "version":2, "settings": { "typography": { "customFontSize": false, "fontSizes": [], "dropCap": false, "fontWeight": false, "fontStyle": false, "textTransform": false, "textDecoration": false, "letterSpacing": false }, "color": { "custom": false, "customDuotone": false, "customGradient": false, "duotone": [], "gradients": [], "palette": [], "background": false, "defaultGradients": false, "defaultPalette": false } } }

The duotone filter still appears on image blocks.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.2, no Gutenberg plugin

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@mrfoxtalbot mrfoxtalbot added Customization Issues related to Phase 2: Customization efforts Needs Testing Needs further testing to be confirmed. [Type] Regression Related to a regression in the latest release [Block] Image Affects the Image Block labels Apr 3, 2023
@skorasaurus skorasaurus removed the Needs Testing Needs further testing to be confirmed. label Apr 4, 2023
@skorasaurus
Copy link
Member

skorasaurus commented Apr 4, 2023

I'm able to reproduce this WP 6.2 (w/o gutenberg activated) as well with Gutenberg 15.4.0 activated.

According to https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#settings the following settings in a theme.json should disable the core gradients from being selected as well as adding new gradients.

I am still able to select the default duotones shipped with WordPress.

{
"version": 2,
"settings": {
"color": {
"custom": false,
"customDuotone": false,
"customGradient": false,
"duotone": [],
"gradients": []
}
}
}

@annezazu
Copy link
Contributor

@ajlende mind taking a look here?

@ajlende
Copy link
Contributor

ajlende commented Apr 30, 2023

This is the expected behavior for your settings.

There is a defaultDuotone option that controls showing the default filters in the UI. So you need to set all three of these settings to fully remove the duotone panel.

{
  "version": 2,
  "settings": {
    "color": {
      "duotone": [],
      "customDuotone": false,
      "defaultDuotone": false
    }
  }
}

The theme.json options will disable UI elements for adding new filters, but default filters will continue to show on the page. In 6.3 the default SVGs will no longer be rendered on pages where they are not used (#49103).

@ajlende ajlende closed this as completed Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block Customization Issues related to Phase 2: Customization efforts [Type] Regression Related to a regression in the latest release
Projects
No open projects
Development

No branches or pull requests

5 participants