Skip to content

Fix Image URL Localization URI#720

Merged
vcanales merged 7 commits intoWordPress:trunkfrom
shimotmk:fix/714
Sep 26, 2024
Merged

Fix Image URL Localization URI#720
vcanales merged 7 commits intoWordPress:trunkfrom
shimotmk:fix/714

Conversation

@shimotmk
Copy link
Copy Markdown
Contributor

@shimotmk shimotmk commented Sep 10, 2024

I fixed the image URI path as per this issue.

fix #714

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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