-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Image blocks relative url #49759
Comments
Initially posted here: https://wordpress.org/support/topic/image-blocks-relative-url/ Thank you for creating this issue @Johanwalter I happen to also ask about this at the beginning of a core-media meeting on Slack. Some feedback during the meeting. The following is from @joedolson @anthonyburchell This also came up:
Comment from Anthony. Comment from Joe. -- We will see what others say. |
Woocommerce handles relative images (for products and categories) |
Here are some related trac tickets shared by Kathryn in the support issue https://core.trac.wordpress.org/ticket/55135 (still open) |
I face the following issue when FSE is enabled for my theme (i.e. when there is a However, it goes away when FSE is disabled. It happens from Gutenberg v16 or so onwards only; it works fine when the plugin is disabled. |
@Johanwalter @paaljoachim @kathrynwp My issue looks specifically related to FSE/block themes because it works as expected if a |
I am not sure @m-muhsin |
Thank you for the ping. This is a duplicate of #31815. The solution right now as a theme developer is to place the image in a block pattern and use PHP to create the correct path. |
Thanks so much, @carolinan! |
Description
Gutenberg does not handle image as relative URL but only as absolute URL
When creating a stagging websites, it has URL image from the prod website.
I have made a copy of prod website from server (copy files, copy database)
Image are https://wwwxxxx.com/wp-content/uploads/xxxx.jpg instead of /wp-content/uploads/xxxx.jpg
This happens on image block and also on Media & text block
Is there any way for Gutenberg to handle image URL as relative URL instead of absolute ?
This is crucial to have and should be normal way to handle image
@paaljoachim
Step-by-step reproduction instructions
1- create stagging website from prod website
2 - check URL in editor code
Screenshots, screen recording, code snippet
No response
Environment info
No response
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
The text was updated successfully, but these errors were encountered: