Skip to content

Unable to change the lightbox settings of the Image block within Global Styles when KSES is active #73157

@mmtr

Description

@mmtr

Description

The KSES filters don't allow to change the lightbox settings of the block image via the Global Styles sidebar in the site editor.

These filters are only registered when a user doesn't have the unfiltered_html capability (which is the case for multisite regular admins).

When these filters are active, any change to the lightbox settings is reverted back to its previous value.

Step-by-step reproduction instructions

  1. Enable the KSES filters with add_action( 'init', 'kses_init_filters' );
  2. Go to Appearance > Editor
  3. Open the Styles sidebar
  4. Select "Blocks"
  5. Select "Image"
  6. Change the "Enlarge on click" options
  7. Save the changes
  8. ⚠️ Note how the changes are reverted

Screenshots, screen recording, code snippet

Screen.Recording.2025-11-11.at.12.40.17.mov

Environment info

  • WordPress: 6.8.3
  • Gutenberg: 22.0.0
  • Theme: Twenty Twenty-Four 1.3

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions