WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 2 months 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 Owned by: 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 2 months ago.
53769-version-bump.diff (6.0 KB) - added by peterwilsoncc 2 months ago.

Download all attachments as: .zip

Change History (10)

@audrasjb
2 months ago

#1 @SergeyBiryukov
2 months ago

  • Milestone changed from Awaiting Review to 5.8.1

#2 @SergeyBiryukov
2 months 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
2 months 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
2 months ago

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

Reopening for backporting to the 5.8 branch.

#5 @peterwilsoncc
2 months 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
2 months 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.


2 months ago

#8 @peterwilsoncc
2 months 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.