WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 20 months ago

#40282 closed defect (bug) (invalid)

header_image hook doesn't update get_theme_mods()

Reported by: strarsis Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.3
Component: Themes Keywords:
Focuses: Cc:

Description

Related: [WordPress WP Display Header plugin](https://wordpress.org/plugins/wp-display-header/)

The current header image is modified using the theme_mod_header_image hook.
However, in get_header_image_tag(...) the function get_custom_header() returns the default header data (including the non-updated URLs) while get_header_image() correctly returns the new header image URL.

Using wp_calculate_image_srcset(...) with the correctly returned new URL as $image_src argument but with the non-updated $image_meta from get_custom_header() no sizes/srcset attributes are rendered at all - just the img element with src to the full resolution image file URL.

Change History (2)

#1 @strarsis
2 years ago

How can I speed up/improve the process?

#2 @obenland
20 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Version 6 of WP Display Header should fix this issue.

Note: See TracTickets for help on using tickets.