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

Make the max-width for images filterable #5567

Closed
florianbrinkmann opened this issue Mar 12, 2018 · 2 comments · Fixed by #5973
Closed

Make the max-width for images filterable #5567

florianbrinkmann opened this issue Mar 12, 2018 · 2 comments · Fixed by #5973
Labels
[Type] Enhancement A suggestion for improvement.

Comments

@florianbrinkmann
Copy link

florianbrinkmann commented Mar 12, 2018

Hi,

I am just working on implementing theme styles for the Gutenberg editor and found the following issue: the images get a max-width of 608 px (the default width of the Gutenberg blocks). But I increased the max width of the blocks to the maximum content width of my theme, which is over 608 pixels.

Now I could overwrite the inline style via CSS and !important but I think it would be nicer to have the ability of filtering the maxWidth value that is set here:

The comment above the settings constant says, »You can override any default settings when calling initializeEditor«, but I have no idea how to call that again without getting an error.

I tried this:

wp.editPost.initializeEditor( 'editor', window._wpGutenbergPost, {'maxWidth': 800 );

But that does not work (I did not really expect it either).

Is there already a way to filter those default settings? If not, would it be possible to add a simple PHP filter that filters the setting’s array that is created in the /lib/client-assets.php (

$editor_settings = array(
) or something like that?

Thanks,
Florian

@jasmussen
Copy link
Contributor

Noting that there are a number of issues related to the max-width and inline image styles per the use of the semantic figure element:

#5706
#5209
#5209 (comment)
#5213
#5460

@jasmussen
Copy link
Contributor

Also related, #5292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants