Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#53769 closed defect (bug) (fixed)

Bundled themes: block-patterns.php file should use `get_template_directory_uri` instead of `get_stylesheet_directory_uri`

Reported by: audrasjb's profile audrasjb Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.8.1 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch fixed-major
Focuses: Cc:

Description

Related: #53752

In Bundled Themes, the block-patterns.php file should use get_template_directory_uri instead of get_stylesheet_directory_uri to avoid issues with child themes.

Attachments (2)

53769.diff (14.3 KB) - added by audrasjb 4 years ago.
53769-version-bump.diff (6.0 KB) - added by peterwilsoncc 4 years ago.

Download all attachments as: .zip

Change History (10)

@audrasjb
4 years ago

#1 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.8.1

#2 @SergeyBiryukov
4 years ago

  • Keywords has-patch added; needs-patch removed

Good catch!

Twenty Ten, Twenty Eleven, and Twenty Twelve appear to be the only affected themes. The rest are already using get_template_directory_uri() for images in inc/block-patterns.php.

#3 @SergeyBiryukov
4 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 51483:

Bundled Themes: Use correct path for loading images in block patterns.

By using get_template_directory_uri() instead of get_stylesheet_directory_uri(), we make sure to include the images from the parent theme.

This avoids displaying missing images in block patterns when using a child theme of Twenty Ten, Twenty Eleven, or Twenty Twelve.

Follow-up to [51033], [51103], [51106].

Props audrasjb.
Fixes #53769.

#4 @SergeyBiryukov
4 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backporting to the 5.8 branch.

#5 @peterwilsoncc
4 years ago

[51483] looks good to me for merging in to the 5.8 branch.

As fatal errors are quite bad, I think version bumps should be committed on this ticket and quick turnaround releases done with a single fix for the affected themes.

#6 @peterwilsoncc
4 years ago

In 53769-version-bump.diff:

  • Twenty Ten becomes 3.5
  • Twenty Eleven becomes 3.9
  • Twenty Twelve becomes 3.5

Bumps in readme and style.css; change log added to readme (todo: codex update).

This ticket was mentioned in Slack in #core-themes by peterwilsoncc. View the logs.


4 years ago

#8 @peterwilsoncc
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 51488:

Bundled Themes: Use correct path for loading images in block patterns.

By using get_template_directory_uri() instead of get_stylesheet_directory_uri(), we make sure to include the images from the parent theme.

This avoids displaying missing images in block patterns when using a child theme of Twenty Ten, Twenty Eleven, or Twenty Twelve.

Follow-up to [51033], [51103], [51106].

Props audrasjb, SergeyBiryukov.
Merges [51483] to the 5.8 branch.
Fixes #53769.

Note: See TracTickets for help on using tickets.