Make WordPress Core

Opened 5 years ago

Closed 5 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 Owned by: SergeyBiryukov
Priority: normal Milestone: 5.8.1
Component: Bundled Theme Version:
Severity: normal Keywords: has-patch fixed-major
Cc: Focuses:

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 5 years ago.
53769-version-bump.diff (6.0 KB ) - added by peterwilsoncc 5 years ago.

Download all attachments as: .zip

Change History (10)

@audrasjb
5 years ago

#1 @SergeyBiryukov
5 years ago

  • Milestone Awaiting Review5.8.1

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

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

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
5 years ago

  • Keywords fixed-major added
  • Resolution fixed
  • Status closedreopened

Reopening for backporting to the 5.8 branch.

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


5 years ago

#8 @peterwilsoncc
5 years ago

  • Resolutionfixed
  • Status reopenedclosed

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.