Open janmckell opened 1 month ago
Hi @janmckell
I was trying to replicate the issue in TT4 theme, but looks like the code snippet you provided might not be a part of theme.json
If we want to alter the mediaWidth setting for the Media & Text block, then we should be updating the mediaWidth
property in the block.json
The file can be found by following this path in the codebase: packages > block-library > src > media-text > block.json
Here is screencast of the expected results after updating it with a new value:
https://github.com/user-attachments/assets/4a072f95-92f3-4582-bf31-87818443a2b4
So I believe in a similar way we can create a block.json and insert the attributes
as per our needs
Hey @Rishit30G
Thank you so much for testing this. :) Okay, I see that this can be set inside the Gutenberg plugin at: build/block-library/blocks/media-text/block.json and by editing the attribute, 'mediaWidth' to the new default number.
Doing it this way isn't a very sustainable option since anytime the Gutenberg plugin is updated, this would be overwritten :( ...so the idea was to determine how it could be set at the block level and from within the theme folder itself.
Hi This is the expected result, media width is not supported in theme.json. Kindly refer to the theme.json reference for all supported settings and style options. https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/
Because of this, I am changing the label from bug to enhancement, so that this may be added in the future.
Hi This is the expected result, media width is not supported in theme.json. Kindly refer to the theme.json reference for all supported settings and style options. https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/
Because of this, I am changing the label from bug to enhancement, so that this may be added in the future.
@carolinan Noted, and thank you very much!!!
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
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:
Also tested:
and this:
Screenshots, screen recording, code snippet
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.
Please confirm that you have tested with all plugins deactivated except Gutenberg.