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

Fix Image URL Localization URI #720

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from
Open

Conversation

shimotmk
Copy link

@shimotmk shimotmk commented Sep 10, 2024

I fixed the image URI path as per this issue.

fix #714

Copy link
Contributor

@matiasbenedetto matiasbenedetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to work fine; it could be merged. However, I found some issues (not strictly related to this change) when creating child themes and bundling images. For example, If I added an image in a child theme and when creating the child theme, the image was bundled in the parent theme, that would need to be fixed, too.

Copy link
Contributor

@madhusudhand madhusudhand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is failing in the following scenario.

Steps:

  1. Active a block theme such as remote and create a child theme.
  2. Now add an image to the child theme, and save.
  3. Now save changes to theme by selecting Save Template Changes, Localize Text, Localize Images.
  4. Observe that the template localizes the image with get_template_directory_uri()
  5. But the image fails to load in the editor.

@shimotmk
Copy link
Author

@madhusudhand
Thank you for your comment. I was able to reproduce the problem. I was able to solve it by setting a condition with is_child_theme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image URL Localization URI
3 participants