Make WordPress Core

Opened 3 months ago

Closed 3 weeks ago

Last modified 3 weeks ago

#58675 closed enhancement (fixed)

Theme: use the_header_image_tag in core themes

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: 6.4 Priority: normal
Severity: normal Version: 4.4
Component: Bundled Theme Keywords: has-patch commit
Focuses: performance Cc:

Description (last modified by spacedmonkey)

There are a number of core themes that do not use the the_header_image_tag function. This function was added in WP 4.4 after some of these theme were introduced. Add a backwards compatibility shim to use this function in core themes.

See the following core themes that need to be updated.

Twenty Eleven
Twenty Fourteen
Twenty sixteen
Twenty Ten
Twenty Twelve

Change History (20)

This ticket was mentioned in PR #4760 on WordPress/wordpress-develop by @spacedmonkey.


3 months ago
#1

  • Keywords has-patch added

#2 @sabernhardt
3 months ago

  • Summary changed from Use the_header_image_tag in 2016 theme to Twenty Sixteen: use the_header_image_tag

#3 @spacedmonkey
3 months ago

  • Description modified (diff)
  • Focuses performance added
  • Milestone changed from Future Release to 6.3
  • Summary changed from Twenty Sixteen: use the_header_image_tag to Theme: use the_header_image_tag

#5 @spacedmonkey
3 months ago

  • Summary changed from Theme: use the_header_image_tag to Theme: use the_header_image_tag in core themes

#6 @swissspidy
3 months ago

This looks more like an enhancement to me

#7 @flixos90
3 months ago

+1 to what @swissspidy says, while this relates to #58680, this is a broader change and goes beyond what I'd consider a critical bug fix - also relates to the fact that this bug was not introduced in trunk but WP 4.4, so not critical.

Given that it touches the core themes with several lines of code changes. I don't feel comfortable committing this so late in the cycle, and furthermore I don't think it's critical enough. I think we should milestone this for 6.4.

cc @desrosj in case you have some guidance when to make such changes

#8 @spacedmonkey
3 months ago

  • Keywords early added
  • Milestone changed from 6.3 to 6.4
  • Type changed from defect (bug) to enhancement

Punting to WordPress 6.4. I agree that that this is an enhancement over a bug. I have pushed @flixos90 to add this ticket to the dev note. Header image not working with this new functionality ( and even older functionality like async decoding ), might be a little confusing. The dev note should include instructions on how to retrofit your theme to support these features and use this ticket / PR as an example.

Marking this as early, myself as the owner and changing to WP 6.4.

Keeping this as part of the performance focus, as adding source sets, decoding async and fetch priority to header images, is a performance win.

#9 @mukesh27
3 months ago

  • Owner set to spacedmonkey
  • Status changed from new to assigned

#10 @hellofromTonya
7 weeks ago

  • Keywords early removed

I don't think this scope of work must be bound to only the early phase of the 6.4 alpha cycle, meaning if it doesn't get done during this early phase then it gets punted. Work here can happen at anytime during Alpha, i.e up to the Beta 1.

This ticket was mentioned in Slack in #core-performance by spacedmonkey. View the logs.


4 weeks ago

#12 @spacedmonkey
4 weeks ago

  • Owner spacedmonkey deleted

This ticket was mentioned in Slack in #core-performance by spacedmonkey. View the logs.


4 weeks ago

#14 @spacedmonkey
3 weeks ago

  • Owner set to flixos90
  • Status changed from assigned to reviewing

#15 @spacedmonkey
3 weeks ago

Assigning to @flixos90 for review.

@spacedmonkey commented on PR #4797:


3 weeks ago
#16

@felixarntz Go catches. Feedback actioned!

#17 @spacedmonkey
3 weeks ago

  • Keywords commit added
  • Owner changed from flixos90 to spacedmonkey

#18 @spacedmonkey
3 weeks ago

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

In 56583:

Bundled Theme: Implement the_header_image_tag function for enhanced compatibility for older core themes.

The the_header_image_tag function was introduced in WordPress 4.4 as part of [35594]. It is used in all themes created post WordPress 4.4 that supported header images. The function get_header_image_tag continues to get updated with new image features, like lazy loading, async decoding and fetch priority. To ensure our core themes maintain compatibility and benefit from these enhancements, a backward compatibility shim has been applied, integrating the the_header_image_tag function into the following core themes:

  • Twenty Ten
  • Twenty Eleven
  • Twenty Twelve
  • Twenty Fourteen
  • Twenty Sixteen

This change ensures future compatibility and modern image features are applied for header images to these older themes.

Props spacedmonkey, flixos90, mukesh27.
Fixes #58675.

Note: See TracTickets for help on using tickets.