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

Merged
merged 7 commits into from
Sep 26, 2024
Merged

Fix Image URL Localization URI #720

merged 7 commits into from
Sep 26, 2024

Conversation

shimotmk
Copy link
Contributor

@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
Member

@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
Contributor 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.

Copy link
Member

@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.

@shimotmk Thanks for addressing the feedback.
Changes looks good to me! 🚀

Copy link
Member

@vcanales vcanales left a comment

Choose a reason for hiding this comment

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

@matiasbenedetto 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.

I think we can address that situation after this fix is merged.

@vcanales vcanales merged commit 55a60de into WordPress:trunk Sep 26, 2024
2 checks passed
@shimotmk shimotmk deleted the fix/714 branch September 26, 2024 11:01
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
4 participants