Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Apply Mike's fix for child theme images #84

Merged
merged 1 commit into from
Mar 1, 2023
Merged

Conversation

kienstra
Copy link
Contributor

@kienstra kienstra commented Feb 28, 2023

Applies Mike's fix for child theme images.

Allows saving images to a child theme.

Fixes #83

How to test

  1. Activate a child theme
  2. Create a new pattern
  3. Add an Image block
  4. Click 'Insert from URL'
  5. Enter https://fastly.picsum.photos/id/90/200/200.jpg?hmac=zltjAmHceKvUbRnvGycGPocNMsLFu-jiTwBEcre1_pU
  6. Save the pattern
  7. Reload the browser
  8. Expected: The image still appears:

Screenshot 2023-02-28 at 5 28 02 PM

@@ -372,7 +372,7 @@ function tree_shake_theme_images() {
$backedup_images_dir = $wp_filesystem->wp_content_dir() . 'temp-images/';
$images_dir = $theme_dir . '/patterns/images/';

$wp_theme_url = get_template_directory_uri();
$wp_theme_url = get_stylesheet_directory_uri();
Copy link
Contributor Author

@kienstra kienstra Feb 28, 2023

Choose a reason for hiding this comment

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

tree_shake_theme_images() isn't used, but it's changed here for completeness

@kienstra kienstra marked this pull request as ready for review February 28, 2023 23:30
Copy link
Contributor

@mikemcalister mikemcalister left a comment

Choose a reason for hiding this comment

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

The fix is good! Thanks for the speedy fix, dude!

@kienstra
Copy link
Contributor Author

kienstra commented Mar 1, 2023

Thanks so much, Mike!

@kienstra kienstra merged commit 84c2415 into main Mar 1, 2023
@kienstra kienstra deleted the fix/theme-images branch March 1, 2023 05:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Image paths don't work in child themes
2 participants