Skip to content

Media-text Block Customization mediaWidth Not Applying in theme.json File #64358

Open

Description

Description

The default mediaWidth setting for the Media & Text block does not change when updated in the theme.json file of a block theme.

Step-by-step reproduction instructions

  1. Install or activate a Block theme (e.g., Twenty Twenty-Four or Twenty Twenty-Three).
  2. Edit the theme’s theme.json file to set block-level settings for the Media & Text block to change the default mediaWidth.
  3. Check the block’s settings in the editor to see if the default mediaWidth has changed.

Expected Result:
The default mediaWidth should update to the new value set in the theme.json file.

Actual Result:
The default mediaWidth remains at 50, even after clearing the cache and switching themes back and forth.

Code Snippet from theme.json:

{
  "settings": {
    "blocks": {
      "core/media-text": {
        "mediaWidth": {
          "type": "number",
          "default": 60
        }
      }
    }
  }
}

Also tested:

"core/media-text": {
        "custom": {
          "mediaWidth": 60
        }
      }

and this:

            "core/media-text": {
        "attributes": {
          "mediaWidth": {
            "type": "number",
            "default": 60
          }
        }
      }

Screenshots, screen recording, code snippet

Markup on 2024-08-07 at 3:45:20 PM

Environment info

– WordPress 6.6.1
– Tested with no Gutenberg plugin
– Also tested with Gutenberg Version 18.9.0
– Browser: Chrome - Version 127.0.6533.90
– Theme: Twenty Twenty-Four and Twenty Twenty-Three
– macOS

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions